[Goodies-commits] r6600 - in xfce4-clipman-plugin/branches/xfce-4-6: . panel-plugin

Mike Massonnet mmassonnet at xfce.org
Fri Jan 30 08:32:48 CET 2009


Author: mmassonnet
Date: 2009-01-30 07:32:48 +0000 (Fri, 30 Jan 2009)
New Revision: 6600

Modified:
   xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog
   xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c
   xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c
Log:
Fix a crasher.

Modified: xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog	2009-01-30 07:11:15 UTC (rev 6599)
+++ xfce4-clipman-plugin/branches/xfce-4-6/ChangeLog	2009-01-30 07:32:48 UTC (rev 6600)
@@ -1,4 +1,12 @@
 2009-01-30	Mike Massonnet
+Fix a crasher.
+
+	- panel-plugin/history.c(clipman_history_clear):
+		Set the item_to_restore to NULL when clearing the history.
+	- panel-plugin/collector.c(_clipman_collector_restore_clipboard):
+		Check if the item to restore is not NULL.
+
+2009-01-30	Mike Massonnet
 Remove the origin of the clipboard from the history items.
 
 	- panel-plugin/history.h, panel-plugin/history.c:

Modified: xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c	2009-01-30 07:11:15 UTC (rev 6599)
+++ xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/collector.c	2009-01-30 07:32:48 UTC (rev 6600)
@@ -219,11 +219,14 @@
    * empty clipboards. */
   const ClipmanHistoryItem *item;
 
-  DBG ("Restore the clipboard with the most recent content from ClipmanHistory");
-
   collector->priv->restoring = TRUE;
 
   item = clipman_history_get_item_to_restore (collector->priv->history);
+  if (item == NULL)
+    return;
+
+  DBG ("Restore the clipboard with the most recent content from ClipmanHistory");
+
   switch (item->type)
     {
     case CLIPMAN_HISTORY_TYPE_TEXT:

Modified: xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c
===================================================================
--- xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c	2009-01-30 07:11:15 UTC (rev 6599)
+++ xfce4-clipman-plugin/branches/xfce-4-6/panel-plugin/history.c	2009-01-30 07:32:48 UTC (rev 6600)
@@ -349,6 +349,8 @@
 
   history->priv->texts = NULL;
   history->priv->images = NULL;
+
+  history->priv->item_to_restore = NULL;
 }
 
 ClipmanHistory *




More information about the Goodies-commits mailing list