commit 771feec77d2d3e2ad13bb718ee3474400daf72f4
Author: scorpion <scorpion@falcon15.BIRDS-OF-PREY>
Date:   Sun Apr 17 19:50:48 2011 +0000

    dispose the initialised directories when quitting

 libgtkpod/directories.c |   17 +++++++++++++++++
 libgtkpod/directories.h |    2 ++
 src/gtkpod.c            |    2 ++
 3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/libgtkpod/directories.c b/libgtkpod/directories.c
index 7c0443d..e4c24a9 100644
--- a/libgtkpod/directories.c
+++ b/libgtkpod/directories.c
@@ -66,6 +66,23 @@ void init_directories(char *argv[]) {
 //    debug_print_directories();
 }
 
+void dispose_directories() {
+    if (datadir)
+        g_free(datadir);
+    if (docdir)
+        g_free(docdir);
+    if (icondir)
+        g_free(icondir);
+    if (uidir)
+        g_free(uidir);
+    if (gladedir)
+        g_free(gladedir);
+    if (plugindir)
+        g_free(plugindir);
+    if (scriptdir)
+        g_free(scriptdir);
+}
+
 #if LOCALDEBUG
 static void debug_print_directories() {
     g_printf("data directory: %s\n", get_data_dir());
diff --git a/libgtkpod/directories.h b/libgtkpod/directories.h
index f71533e..7f4ad51 100644
--- a/libgtkpod/directories.h
+++ b/libgtkpod/directories.h
@@ -13,6 +13,8 @@
 
 void init_directories(char *argv[]);
 
+void dispose_directories();
+
 gboolean using_local();
 
 gchar * get_data_dir();
diff --git a/src/gtkpod.c b/src/gtkpod.c
index 5bce2e1..13c5e29 100644
--- a/src/gtkpod.c
+++ b/src/gtkpod.c
@@ -249,6 +249,8 @@ static gboolean on_gtkpod_delete_event(GtkWidget *widget, 
GdkEvent *event, gpoin
 }
 
 static void on_gtkpod_destroy(GtkWidget * w, gpointer data) {
+    dispose_directories();
+
     gtk_widget_hide(w);
     gtk_main_quit();
 }

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to