Author: juha
Date: 2007-12-20 23:49:14 +0000 (Thu, 20 Dec 2007)
New Revision: 26497

Modified:
   xfcalendar/trunk/src/interface.c
   xfcalendar/trunk/src/parameters.c
Log:
Fixed two small memory leaks.
libical file open still leaks, but that is hard to fix.


Modified: xfcalendar/trunk/src/interface.c
===================================================================
--- xfcalendar/trunk/src/interface.c    2007-12-20 22:03:37 UTC (rev 26496)
+++ xfcalendar/trunk/src/interface.c    2007-12-20 23:49:14 UTC (rev 26497)
@@ -106,11 +106,6 @@
         return(FALSE);
 }
 
-static void on_destroy(GtkWidget *window, gpointer user_data)
-{
-     interface_lock = FALSE;
-}
-
 void static orage_file_entry_changed(GtkWidget *dialog, gpointer user_data)
 {
     intf_win *intf_w = (intf_win *)user_data;
@@ -729,7 +724,9 @@
     intf_win *intf_w = (intf_win *)user_data;
 
     gtk_widget_destroy(intf_w->main_window);
+    gtk_object_destroy(GTK_OBJECT(intf_w->tooltips));
     g_free(intf_w);
+    interface_lock = FALSE;
 }
 
 void close_button_clicked(GtkButton *button, gpointer user_data)
@@ -742,6 +739,13 @@
     close_intf_w(user_data);
 }
 
+static gboolean on_Window_delete_event(GtkWidget *w, GdkEvent *e
+        , gpointer user_data)
+{
+    close_intf_w(user_data);
+    return(FALSE);
+}
+
 void create_menu(intf_win *intf_w)
 {
     /*
@@ -1315,8 +1319,8 @@
     create_orage_file_tab(intf_w);
     create_foreign_file_tab(intf_w);
 
-     g_signal_connect(G_OBJECT(intf_w->main_window), "destroy",
-             G_CALLBACK(on_destroy), NULL);
+     g_signal_connect((gpointer)intf_w->main_window, "delete_event",
+             G_CALLBACK(on_Window_delete_event), intf_w);
 
     gtk_widget_show_all(intf_w->main_window);
     drag_and_drop_init(intf_w);

Modified: xfcalendar/trunk/src/parameters.c
===================================================================
--- xfcalendar/trunk/src/parameters.c   2007-12-20 22:03:37 UTC (rev 26496)
+++ xfcalendar/trunk/src/parameters.c   2007-12-20 23:49:14 UTC (rev 26497)
@@ -820,7 +820,7 @@
 
 void read_parameters(void)
 {
-    gchar *fpath;
+    gchar *fpath, *fpath2;
     XfceRc *rc;
     gint i;
     gchar f_par[100];
@@ -841,11 +841,14 @@
             g_strdup(xfce_rc_read_entry(rc, "Timezone", "floating"));
 #ifdef HAVE_ARCHIVE
     g_par.archive_limit = xfce_rc_read_int_entry(rc, "Archive limit", 0);
-    g_par.archive_file = g_strdup(xfce_rc_read_entry(rc, "Archive file"
-            , orage_resource_file_location(ORAGE_DIR ARCFILE)));
+    fpath2 = orage_resource_file_location(ORAGE_DIR ARCFILE);
+    g_par.archive_file = 
+            g_strdup(xfce_rc_read_entry(rc, "Archive file", fpath2));
+    g_free(fpath2);
 #endif
-    g_par.orage_file = g_strdup(xfce_rc_read_entry(rc, "Orage file"
-            , orage_resource_file_location(ORAGE_DIR APPFILE)));
+    fpath2 = orage_resource_file_location(ORAGE_DIR APPFILE);
+    g_par.orage_file = g_strdup(xfce_rc_read_entry(rc, "Orage file", fpath2));
+    g_free(fpath2);
     g_par.sound_application = 
             g_strdup(xfce_rc_read_entry(rc, "Sound application", "play"));
     g_par.pos_x = xfce_rc_read_int_entry(rc, "Main window X", 0);

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to