[gnome-photos] base-manager: Ref the new active item only if it is non-NULL
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-manager: Ref the new active item only if it is non-NULL
- Date: Mon, 30 Apr 2012 22:51:52 +0000 (UTC)
commit 6203c35642895984794493b738b5cd25bb2d8656
Author: Debarshi Ray <debarshir gnome org>
Date: Tue May 1 00:35:49 2012 +0200
base-manager: Ref the new active item only if it is non-NULL
src/photos-base-manager.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-base-manager.c b/src/photos-base-manager.c
index 80c7814..f9728c7 100644
--- a/src/photos-base-manager.c
+++ b/src/photos-base-manager.c
@@ -211,7 +211,9 @@ photos_base_manager_set_active_item (PhotosBaseManager *self, PhotosBaseItem *it
if (priv->active_item != NULL)
g_object_unref (priv->active_item);
- g_object_ref (item);
+ if (item != NULL)
+ g_object_ref (item);
+
priv->active_item = item;
g_signal_emit (self, signals[ACTIVE_CHANGED], 0, item);
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]