Author: olivier
Date: 2006-09-04 20:47:18 +0000 (Mon, 04 Sep 2006)
New Revision: 23084

Modified:
   libxfcegui4/trunk/libxfcegui4/xfce_clock.c
Log:
Clock's format_string was leaked in previous patch

Modified: libxfcegui4/trunk/libxfcegui4/xfce_clock.c
===================================================================
--- libxfcegui4/trunk/libxfcegui4/xfce_clock.c  2006-09-04 20:41:19 UTC (rev 
23083)
+++ libxfcegui4/trunk/libxfcegui4/xfce_clock.c  2006-09-04 20:47:18 UTC (rev 
23084)
@@ -440,6 +440,11 @@
 
     clock = XFCE_CLOCK (object);
 
+    if (clock->format_string != NULL)
+    {
+        g_free (clock->format_string);
+        clock->format_string = NULL;
+    }
 
     if (clock->digits_bmap)
     {
@@ -706,7 +711,6 @@
         clock->format_string = NULL;
     }
 
-    clock->format_string = NULL;
     if (format != NULL)
     {
         clock->format_string = g_strdup (format);
@@ -754,8 +758,7 @@
                 time_t ticks = time (0);
                 struct tm *tm = localtime (&ticks);
 
-                xfce_clock_format_time_to_utf8 (buffer, 256,
-                                                clock->format_string, tm);
+                xfce_clock_format_time_to_utf8 (buffer, 256, 
clock->format_string, tm);
 
             }
             else if (clock->military_time)
@@ -1085,8 +1088,9 @@
             h = 12;
     }
 
-    if (clock->show_formatted &&
-        clock->format_string != NULL && strlen (clock->format_string) != 0)
+    if ((clock->show_formatted) &&
+        (clock->format_string != NULL) && 
+        (strlen (clock->format_string) != 0))
     {
         xfce_clock_format_time_to_utf8 (time_buf, sizeof(time_buf), 
clock->format_string, tm);
 

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

Reply via email to