]> spindle.queued.net Git - midori/commitdiff
Only disconnect signals when we actually have search engines
authorChristian Dywan <christian@twotoasts.de>
Sat, 28 Feb 2009 13:02:36 +0000 (14:02 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sat, 28 Feb 2009 13:02:36 +0000 (14:02 +0100)
midori/midori-searchaction.c

index b789981bfbd9d6b0704d7d3da9ddf92a733d9c0b..7a64e41af113422f343e8c58f8dea2ea86304e86 100644 (file)
@@ -1024,12 +1024,15 @@ static void
 midori_search_action_treeview_destroy_cb (GtkWidget*          treeview,
                                           MidoriSearchAction* search_action)
 {
-    g_signal_handlers_disconnect_by_func (
-        search_action->search_engines,
-        midori_search_action_dialog_engines_add_item_cb, search_action);
-    g_signal_handlers_disconnect_by_func (
-        search_action->search_engines,
-        midori_search_action_dialog_engines_remove_item_cb, search_action);
+    if (search_action->search_engines)
+    {
+        g_signal_handlers_disconnect_by_func (
+            search_action->search_engines,
+            midori_search_action_dialog_engines_add_item_cb, search_action);
+        g_signal_handlers_disconnect_by_func (
+            search_action->search_engines,
+            midori_search_action_dialog_engines_remove_item_cb, search_action);
+    }
 }
 
 /**