From 97911ac99f187a7c2c3eb4324b04cbb39b8e9bee Mon Sep 17 00:00:00 2001 From: Vasily_Makarov Date: Thu, 20 Oct 2011 09:18:58 +0400 Subject: Correct freeing info after opening new file or creating new --- saedit/interface.c | 2 +- saedit/interface.ui | 46 +++++++++++++++++++++++----------------------- saedit/main.c | 7 ++++++- saedit/main.h | 3 +++ 4 files changed, 33 insertions(+), 25 deletions(-) (limited to 'saedit') diff --git a/saedit/interface.c b/saedit/interface.c index 8238416..cda7493 100644 --- a/saedit/interface.c +++ b/saedit/interface.c @@ -57,7 +57,7 @@ void file_new() { gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(xml_file_chooser_button), ""); gtk_widget_set_sensitive(reload_menu_item, FALSE); - free_lists(gen_sae_info); + free_current_info(); } void set_up_interface() { diff --git a/saedit/interface.ui b/saedit/interface.ui index 73193ee..59127fd 100644 --- a/saedit/interface.ui +++ b/saedit/interface.ui @@ -471,7 +471,7 @@ Reid Yaro <reidyaro@gmail.com> False False - 4 + 5 @@ -490,21 +490,6 @@ Reid Yaro <reidyaro@gmail.com> 5 - - - True - False - Imagesets - - - - - - False - False - 7 - - Parse XML Buffer @@ -517,14 +502,14 @@ Reid Yaro <reidyaro@gmail.com> False False - 7 + 6 - + True False - Actions + Imagesets @@ -532,7 +517,7 @@ Reid Yaro <reidyaro@gmail.com> False False - 9 + 7 @@ -550,10 +535,10 @@ Reid Yaro <reidyaro@gmail.com> - + True False - Directions + Actions @@ -561,7 +546,7 @@ Reid Yaro <reidyaro@gmail.com> False False - 11 + 9 @@ -577,6 +562,21 @@ Reid Yaro <reidyaro@gmail.com> 11 + + + True + False + Directions + + + + + + False + False + 11 + + True diff --git a/saedit/main.c b/saedit/main.c index 8385f60..bf5b5e4 100644 --- a/saedit/main.c +++ b/saedit/main.c @@ -110,7 +110,7 @@ void open_xml_file(GtkButton *button) { gtk_file_chooser_unselect_all(GTK_FILE_CHOOSER(xml_file_chooser_button)); } - free_lists(gen_sae_info); + free_current_info(); } void save_to_xml_file(gchar *filename) { @@ -158,6 +158,11 @@ void free_lists(SAEInfo *sae_info) { free_animations(sae_info); } +void free_current_info() { + free_lists(gen_sae_info); + player = NULL; +} + //Callbacks void data_folder_set_callback(GtkFileChooserButton *widget, gpointer data) { diff --git a/saedit/main.h b/saedit/main.h index 163a685..af78d8f 100644 --- a/saedit/main.h +++ b/saedit/main.h @@ -75,6 +75,9 @@ void free_imagesets(SAEInfo *sae_info); void free_actions(SAEInfo *sae_info); void free_animations(SAEInfo *sae_info); void free_imageset(SAEInfo *sae_info); +void free_lists(SAEInfo *sae_info); + +void free_current_info(); //Callbacks void data_folder_set_callback(GtkFileChooserButton *widget, gpointer data); -- cgit v1.2.3-70-g09d2