[gthumb/ext] check for NULL pointer before unreferencing
- From: Paolo Bacchilega <paobac src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gthumb/ext] check for NULL pointer before unreferencing
- Date: Sat, 29 Aug 2009 11:30:21 +0000 (UTC)
commit 1802fdb9e12bce8b765732981533a94538fb730f
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sat Aug 29 13:29:36 2009 +0200
check for NULL pointer before unreferencing
gthumb/gth-main.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gthumb/gth-main.c b/gthumb/gth-main.c
index 6fa4dee..b177e17 100644
--- a/gthumb/gth-main.c
+++ b/gthumb/gth-main.c
@@ -124,11 +124,14 @@ gth_main_finalize (GObject *object)
g_list_foreach (gth_main->priv->metadata_provider, (GFunc) g_object_unref, NULL);
g_list_free (gth_main->priv->metadata_provider);
- g_hash_table_unref (gth_main->priv->sort_types);
- g_hash_table_unref (gth_main->priv->tests);
- g_hash_table_unref (gth_main->priv->loaders);
-
- g_hash_table_unref (gth_main->priv->types);
+ if (gth_main->priv->sort_types != NULL)
+ g_hash_table_unref (gth_main->priv->sort_types);
+ if (gth_main->priv->tests != NULL)
+ g_hash_table_unref (gth_main->priv->tests);
+ if (gth_main->priv->loaders != NULL)
+ g_hash_table_unref (gth_main->priv->loaders);
+ if (gth_main->priv->types != NULL)
+ g_hash_table_unref (gth_main->priv->types);
if (gth_main->priv->bookmarks != NULL)
g_bookmark_file_free (gth_main->priv->bookmarks);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]