voila un bout de coude qui m'envoie un segfault à l'appel du destructor
Code :
- typedef struct Light {
- int id;
- ...
- } *Light;
- Light lightConstructor(int id) {
- l=(Light) malloc (sizeof(struct Light));
- ...
- }
- void lightDestructor(Light *l) {
- free(l);
- }
- void foo(void) {
- Light l;
- l=lightConstructor(1);
- ...
- lightDestructor(&l);
- exit(0);
- }
|
il y a un problème sur mon destructor ou sur mon appel ou les 2 ?
merci pour les réponses 
Message édité par xav14 le 17-03-2004 à 13:34:52