[Window] Unbind global keybinding during dispose
authorIra W. Snyder <devel@irasnyder.com>
Wed, 23 Jan 2008 06:30:24 +0000 (22:30 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Wed, 23 Jan 2008 06:30:24 +0000 (22:30 -0800)
Previously, the global keybinding was not released during TildaWindow's
dispose phase. This made it possible to enter the callback without a
valid TildaWindow. Eek.

tilda-window.c

index 87849d8..afb32c5 100644 (file)
@@ -677,6 +677,10 @@ tilda_window_dispose (GObject *obj)
        g_ptr_array_foreach (self->terms, my_unref, NULL);
        gtk_widget_destroy (self->window);
 
+       /* Unbind if we were set */
+       if (self->key)
+               tomboy_keybinder_unbind (self->key, tilda_window_keybinding_cb);
+
        /* Chain up to the parent class */
        G_OBJECT_CLASS (parent_class)->dispose (obj);
 }