From bf28f9ee7e5e62ee5b31e366c8e10451f1e5a6ee Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 2 Oct 2005 22:02:57 +0000 Subject: Make sure we don't unref NULL objects. 2005-10-03 Christian Persch * embed/ephy-embed-shell.c: (ephy_embed_shell_dispose): * src/ephy-shell.c: (ephy_shell_dispose): Make sure we don't unref NULL objects. --- embed/ephy-embed-shell.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'embed/ephy-embed-shell.c') diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index fb7a7d216..acee03562 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -90,27 +90,30 @@ static void ephy_embed_shell_dispose (GObject *object) { EphyEmbedShell *shell = EPHY_EMBED_SHELL (object); + EphyEmbedShellPrivate *priv = shell->priv; - if (shell->priv->downloader_view) + if (priv->downloader_view != NULL) { LOG ("Unref downloader"); g_object_remove_weak_pointer - (G_OBJECT(shell->priv->downloader_view), - (gpointer *) &shell->priv->downloader_view); - g_object_unref (shell->priv->downloader_view); + (G_OBJECT (priv->downloader_view), + (gpointer *) &priv->downloader_view); + g_object_unref (priv->downloader_view); + priv->downloader_view = NULL; } - if (shell->priv->favicon_cache) + if (priv->favicon_cache != NULL) { LOG ("Unref favicon cache"); - g_object_unref (G_OBJECT (shell->priv->favicon_cache)); + g_object_unref (priv->favicon_cache); + priv->favicon_cache = NULL; } - if (shell->priv->encodings) - LOG ("Unref encodings"); + if (priv->encodings != NULL) { LOG ("Unref encodings"); - g_object_unref (G_OBJECT (shell->priv->encodings)); + g_object_unref (priv->encodings); + priv->encodings = NULL; } G_OBJECT_CLASS (parent_class)->dispose (object); -- cgit v1.2.3