aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-10-08 02:59:19 +0800
committerXan Lopez <xan@igalia.com>2012-10-08 02:59:19 +0800
commit96e1a8a78c9a943a912e315b2900b49563b06947 (patch)
treef5739cf766cd04ba3e86ace828e63a1a1c7d2284 /src
parent21caa3e6826f50e36ec3088c147e843dd34eedbb (diff)
downloadgsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.tar
gsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.tar.gz
gsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.tar.bz2
gsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.tar.lz
gsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.tar.xz
gsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.tar.zst
gsoc2013-epiphany-96e1a8a78c9a943a912e315b2900b49563b06947.zip
ephy-shell: use g_clear_{object, pointer} in dispose
Diffstat (limited to 'src')
-rw-r--r--src/ephy-shell.c68
1 files changed, 12 insertions, 56 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 763ceeb77..9fa31bacf 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -570,65 +570,21 @@ ephy_shell_init (EphyShell *shell)
static void
ephy_shell_dispose (GObject *object)
{
- EphyShell *shell = EPHY_SHELL (object);
- EphyShellPrivate *priv = shell->priv;
+ EphyShellPrivate *priv = EPHY_SHELL (object)->priv;
LOG ("EphyShell disposing");
- if (shell->priv->extensions_manager != NULL) {
- LOG ("Unref extension manager");
- /* this will unload the extensions */
- g_object_unref (priv->extensions_manager);
- priv->extensions_manager = NULL;
- }
-
- if (priv->session != NULL) {
- LOG ("Unref session manager");
- g_object_unref (priv->session);
- priv->session = NULL;
- }
-
- if (priv->lockdown != NULL) {
- LOG ("Unref lockdown controller");
- g_object_unref (priv->lockdown);
- priv->lockdown = NULL;
- }
-
- if (priv->bme != NULL) {
- LOG ("Unref Bookmarks Editor");
- gtk_widget_destroy (GTK_WIDGET (priv->bme));
- priv->bme = NULL;
- }
-
- if (priv->history_window != NULL) {
- LOG ("Unref History Window");
- gtk_widget_destroy (GTK_WIDGET (priv->history_window));
- priv->history_window = NULL;
- }
-
- if (priv->pdm_dialog != NULL) {
- LOG ("Unref PDM Dialog");
- g_object_unref (priv->pdm_dialog);
- priv->pdm_dialog = NULL;
- }
-
- if (priv->prefs_dialog != NULL) {
- LOG ("Unref prefs dialog");
- g_object_unref (priv->prefs_dialog);
- priv->prefs_dialog = NULL;
- }
-
- if (priv->bookmarks != NULL) {
- LOG ("Unref bookmarks");
- g_object_unref (priv->bookmarks);
- priv->bookmarks = NULL;
- }
-
- if (priv->network_monitor != NULL) {
- LOG ("Unref net monitor ");
- g_object_unref (priv->network_monitor);
- priv->network_monitor = NULL;
- }
+ /* This will unload the extensions. */
+ g_clear_object (&priv->extensions_manager);
+
+ g_clear_object (&priv->session);
+ g_clear_object (&priv->lockdown);
+ g_clear_pointer (&priv->bme, gtk_widget_destroy);
+ g_clear_pointer (&priv->history_window, gtk_widget_destroy);
+ g_clear_object (&priv->pdm_dialog);
+ g_clear_object (&priv->prefs_dialog);
+ g_clear_object (&priv->bookmarks);
+ g_clear_object (&priv->network_monitor);
G_OBJECT_CLASS (ephy_shell_parent_class)->dispose (object);
}