diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-08-02 06:55:53 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-08-02 06:55:53 +0800 |
commit | 20f21975e18eb372d532d016bb755004e00e2e3b (patch) | |
tree | 7d912544bf66198e06ced6a12f71a01ad6c46eaa /lib/ephy-dialog.c | |
parent | d236c947b918c43ca37e7e366aeacbce13395537 (diff) | |
download | gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.tar gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.tar.gz gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.tar.bz2 gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.tar.lz gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.tar.xz gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.tar.zst gsoc2013-epiphany-20f21975e18eb372d532d016bb755004e00e2e3b.zip |
Make sure props are saved when destroyed.
2003-08-02 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/ephy-dialog.c: (ephy_dialog_dispose),
(ephy_dialog_class_init), (ephy_dialog_init),
(ephy_dialog_finalize), (dialog_destroy_cb):
Make sure props are saved when destroyed.
Diffstat (limited to 'lib/ephy-dialog.c')
-rw-r--r-- | lib/ephy-dialog.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c index 324d9b706..79b70c257 100644 --- a/lib/ephy-dialog.c +++ b/lib/ephy-dialog.c @@ -102,6 +102,7 @@ struct EphyDialogPrivate PropertyInfo *props; gboolean modal; gboolean has_default_size; + gboolean disposing; char *name; int spin_item_id; @@ -142,6 +143,19 @@ ephy_dialog_get_type (void) } static void +ephy_dialog_dispose (GObject *object) +{ + EphyDialog *dialog = EPHY_DIALOG (object); + + if (dialog->priv->dialog) + { + dialog->priv->disposing = TRUE; + gtk_widget_destroy (dialog->priv->dialog); + dialog->priv->dialog = NULL; + } +} + +static void ephy_dialog_class_init (EphyDialogClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -149,6 +163,7 @@ ephy_dialog_class_init (EphyDialogClass *klass) parent_class = g_type_class_peek_parent (klass); object_class->finalize = ephy_dialog_finalize; + object_class->dispose = ephy_dialog_dispose; object_class->set_property = ephy_dialog_set_property; object_class->get_property = ephy_dialog_get_property; @@ -792,6 +807,7 @@ ephy_dialog_init (EphyDialog *dialog) dialog->priv->name = NULL; dialog->priv->initialized = FALSE; dialog->priv->has_default_size = FALSE; + dialog->priv->disposing = FALSE; } static void @@ -932,11 +948,6 @@ ephy_dialog_finalize (GObject *object) g_return_if_fail (dialog->priv != NULL); - if (dialog->priv->dialog) - { - gtk_widget_destroy (dialog->priv->dialog); - } - free_props (dialog->priv->props); g_free (dialog->priv->name); @@ -1062,13 +1073,15 @@ init_props (const EphyDialogProperty *properties, GladeXML *gxml) static void dialog_destroy_cb (GtkWidget *widget, EphyDialog *dialog) { - if (dialog->priv->props && - dialog->priv->dialog) + if (dialog->priv->props) { save_props (dialog->priv->props); } - g_object_unref (dialog); + if (!dialog->priv->disposing) + { + g_object_unref (dialog); + } } static void |