[Xfce4-commits] <xfce4-panel:master> Clock plugin, an attempt to fix random crashes.

Andrzej noreply at xfce.org
Sun Mar 3 12:02:09 CET 2013


Updating branch refs/heads/master
         to c09730c9ccafacdd916b7ec1514d7159eb672e04 (commit)
       from 9eb22de2489a039b50e7227a0e41aaa62fd9696f (commit)

commit c09730c9ccafacdd916b7ec1514d7159eb672e04
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Tue Feb 26 22:38:33 2013 +0000

    Clock plugin, an attempt to fix random crashes.
    
    Reports of random segfaults when adding/removing the plugin.
    Can't be reproduced here.

 plugins/clock/clock-time.c |    6 ++++--
 plugins/clock/clock-time.h |    4 ++++
 plugins/clock/clock.c      |    1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/plugins/clock/clock-time.c b/plugins/clock/clock-time.c
index df7cd6b..16b0f89 100644
--- a/plugins/clock/clock-time.c
+++ b/plugins/clock/clock-time.c
@@ -74,7 +74,7 @@ enum
 static guint clock_time_signals[LAST_SIGNAL] = { 0, };
 
 
-G_DEFINE_TYPE (ClockTime, clock_time, G_TYPE_OBJECT)
+XFCE_PANEL_DEFINE_TYPE (ClockTime, clock_time, G_TYPE_OBJECT)
 
 
 
@@ -347,11 +347,13 @@ clock_time_timeout_set_interval (ClockTimeTimeout *timeout,
 {
   GDateTime *time;
   guint      next_interval;
-  gboolean   restart = timeout->restart;
+  gboolean   restart;
 
   panel_return_if_fail (timeout != NULL);
   panel_return_if_fail (interval > 0);
 
+  restart = timeout->restart;
+
   /* leave if nothing changed and we're not restarting */
   if (!restart && timeout->interval == interval)
     return;
diff --git a/plugins/clock/clock-time.h b/plugins/clock/clock-time.h
index 83745d1..dd0fe2c 100644
--- a/plugins/clock/clock-time.h
+++ b/plugins/clock/clock-time.h
@@ -20,6 +20,8 @@
 #define __CLOCK_TIME_H__
 
 #include <glib.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfce4panel/libxfce4panel.h>
 
 G_BEGIN_DECLS
 
@@ -41,6 +43,8 @@ typedef struct _ClockTimeTimeout   ClockTimeTimeout;
 
 GType               clock_time_get_type               (void) G_GNUC_CONST;
 
+void                clock_time_register_type          (XfcePanelTypeModule *type_module);
+
 ClockTime          *clock_time_new                    (void);
 
 ClockTimeTimeout   *clock_time_timeout_new            (guint                interval,
diff --git a/plugins/clock/clock.c b/plugins/clock/clock.c
index a09d562..f7161db 100644
--- a/plugins/clock/clock.c
+++ b/plugins/clock/clock.c
@@ -174,6 +174,7 @@ enum
 
 /* define the plugin */
 XFCE_PANEL_DEFINE_PLUGIN (ClockPlugin, clock_plugin,
+  clock_time_register_type,
   xfce_clock_analog_register_type,
   xfce_clock_binary_register_type,
   xfce_clock_digital_register_type,


More information about the Xfce4-commits mailing list