mirror of
git://projects.qi-hardware.com/fped.git
synced 2025-04-21 12:27:27 +03:00
- delete.c: added more destructor functions
- deallocate all our data structures on exit (to help find memory leaks, bad pointers, and general logic errors) - fixed memory leak when allocating pad names in instantiation - added "magic" environment variable FPED_NO_GUI to run fped without initializing Gtk+ - added valgrind wrapper "leakcheck" - delete.c: destroy() now requires a deletion to exist - vacate_op: free string expressions - destroy_obj: free measurement labels - delete_references: use do_delete_obj so the we don't bump the group number - delete_frame: delete references after deleting the frame itself, so they end up on the stack above the frame and get destroyed first - do_delete_vec: like above, even though it doesn't matter here git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5506 99fdad57-331a-0410-800a-d7fa5415bdb3
This commit is contained in:
27
fped.c
27
fped.c
@@ -22,6 +22,7 @@
|
||||
#include "inst.h"
|
||||
#include "file.h"
|
||||
#include "gui.h"
|
||||
#include "delete.h"
|
||||
#include "fpd.h"
|
||||
|
||||
|
||||
@@ -55,10 +56,13 @@ int main(int argc, char **argv)
|
||||
int error;
|
||||
int batch_write_kicad = 0, batch_write_ps = 0;
|
||||
int c;
|
||||
int have_gui = !getenv("FPED_NO_GUI");
|
||||
|
||||
error = gui_init(&argc, &argv);
|
||||
if (error)
|
||||
return error;
|
||||
if (have_gui) {
|
||||
error = gui_init(&argc, &argv);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
while ((c = getopt(argc, argv, "kp")) != EOF)
|
||||
switch (c) {
|
||||
@@ -102,15 +106,16 @@ int main(int argc, char **argv)
|
||||
write_kicad();
|
||||
if (batch_write_ps)
|
||||
write_ps();
|
||||
if (batch_write_kicad || batch_write_ps)
|
||||
exit(0);
|
||||
|
||||
// inst_debug();
|
||||
error = gui_main();
|
||||
if (error)
|
||||
return error;
|
||||
if (have_gui && !batch_write_kicad && !batch_write_ps) {
|
||||
error = gui_main();
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
|
||||
// dump(stdout);
|
||||
purge();
|
||||
inst_revert();
|
||||
obj_cleanup();
|
||||
unique_cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user