Commit ccd897d2 authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Emmanuele Bassi

Move the signal and idle disconnections into the dispose function, as well

2006-12-31  Emmanuele Bassi  <ebassi@gnome.org>

	* gtk/gtkrecentchoosermenu.c: Move the signal and idle
	disconnections into the dispose function, as well as the
	object unrefs; reset every handler id and the
	pointers. (suggested by Paolo Borelli, #390873)

svn path=/trunk/; revision=16997
parent 1bb498e3
2006-12-31 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchoosermenu.c: Move the signal and idle
disconnections into the dispose function, as well as the
object unrefs; reset every handler id and the
pointers. (suggested by Paolo Borelli, #390873)
2006-12-31 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprintoperation-win32.c: Include windows.h (#391229,
......
......@@ -94,6 +94,7 @@ enum {
#define GTK_RECENT_CHOOSER_MENU_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_RECENT_CHOOSER_MENU, GtkRecentChooserMenuPrivate))
static void gtk_recent_chooser_menu_finalize (GObject *object);
static void gtk_recent_chooser_menu_dispose (GObject *object);
static GObject *gtk_recent_chooser_menu_constructor (GType type,
guint n_construct_properties,
GObjectConstructParam *construct_params);
......@@ -181,6 +182,7 @@ gtk_recent_chooser_menu_class_init (GtkRecentChooserMenuClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructor = gtk_recent_chooser_menu_constructor;
gobject_class->dispose = gtk_recent_chooser_menu_dispose;
gobject_class->finalize = gtk_recent_chooser_menu_finalize;
gobject_class->set_property = gtk_recent_chooser_menu_set_property;
gobject_class->get_property = gtk_recent_chooser_menu_get_property;
......@@ -240,30 +242,51 @@ gtk_recent_chooser_menu_finalize (GObject *object)
GtkRecentChooserMenu *menu = GTK_RECENT_CHOOSER_MENU (object);
GtkRecentChooserMenuPrivate *priv = menu->priv;
g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
priv->manager_changed_id = 0;
if (priv->populate_id)
g_source_remove (priv->populate_id);
priv->manager = NULL;
if (priv->sort_data_destroy)
{
priv->sort_data_destroy (priv->sort_data);
priv->sort_data_destroy = NULL;
priv->sort_data = NULL;
priv->sort_func = NULL;
}
priv->sort_data = NULL;
priv->sort_func = NULL;
if (priv->tooltips)
g_object_unref (priv->tooltips);
G_OBJECT_CLASS (gtk_recent_chooser_menu_parent_class)->finalize (object);
}
static void
gtk_recent_chooser_menu_dispose (GObject *object)
{
GtkRecentChooserMenu *menu = GTK_RECENT_CHOOSER_MENU (object);
GtkRecentChooserMenuPrivate *priv = menu->priv;
if (priv->manager_changed_id)
{
g_signal_handler_disconnect (priv->manager, priv->manager_changed_id);
priv->manager_changed_id = 0;
}
if (priv->populate_id)
{
g_source_remove (priv->populate_id);
priv->populate_id = 0;
}
if (priv->tooltips)
{
g_object_unref (priv->tooltips);
priv->tooltips = NULL;
}
if (priv->current_filter)
g_object_unref (priv->current_filter);
{
g_object_unref (priv->current_filter);
priv->current_filter = NULL;
}
G_OBJECT_CLASS (gtk_recent_chooser_menu_parent_class)->finalize (object);
G_OBJECT_CLASS (gtk_recent_chooser_menu_parent_class)->dispose (object);
}
static GObject *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment