Browse Source

free spice_init_devices() allocated memory in com_quit()

rlar 14 years ago
parent
commit
71240d19be
  1. 2
      src/frontend/misccoms.c
  2. 4
      src/main.c
  3. 12
      src/spicelib/devices/dev.c
  4. 1
      src/spicelib/devices/dev.h

2
src/frontend/misccoms.c

@ -29,6 +29,7 @@ extern char history_file[];
#endif
extern IFsimulator SIMinfo;
extern void spice_destroy_devices(void); /* FIXME need a better place */
static void byemesg(void);
static int confirm_quit(void);
@ -80,6 +81,7 @@ com_quit(wordlist *wl)
byemesg();
destroy_const_plot();
spice_destroy_devices();
exit(exitcode);
}

4
src/main.c

@ -374,6 +374,10 @@ void SMPprintRHS( SMPmatrix *n1, char *n2 , double* n3 , double* n4)
return;
}
void spice_destroy_devices(void)
{
}
#endif /* SIMULATOR */
#ifndef SIMULATOR

12
src/spicelib/devices/dev.c

@ -233,6 +233,18 @@ int load_vadev(CKTcircuit *ckt, char *name)
}
#endif
void
spice_destroy_devices(void)
{
#ifdef XSPICE
tfree(g_evt_udn_info);
tfree(DEVicesfl);
#endif
tfree(DEVices);
}
void
spice_init_devices(void)
{

1
src/spicelib/devices/dev.h

@ -3,6 +3,7 @@
void spice_init_devices(void);
void spice_destroy_devices(void);
int num_devices(void);
IFdevice **devices_ptr(void);
SPICEdev **devices(void);

Loading…
Cancel
Save