[gnome-photos] remote-display-manager: Avoid unref'ing NULL in case of errors, again



commit 14ebdacdb33103f932107746d2c2068d80d7bc90
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Wed Aug 7 13:38:26 2013 +0200

    remote-display-manager: Avoid unref'ing NULL in case of errors, again
    
    Ouch. Commit 37dfb5cc inadvertently reverted 3f01ccd, reapply.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705435

 src/photos-remote-display-manager.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-remote-display-manager.c b/src/photos-remote-display-manager.c
index 22e1913..8248de5 100644
--- a/src/photos-remote-display-manager.c
+++ b/src/photos-remote-display-manager.c
@@ -173,18 +173,18 @@ photos_remote_display_manager_share_cb (GObject      *source_object,
   GError *error = NULL;
 
   item = photos_dlna_renderer_share_finish (renderer, res, &error);
-  g_object_unref (item); /* We already hold a ref to the item to be shared */
 
   if (error != NULL)
     {
       g_warning ("Unable to remotely display item '%s': %s",
-                 item != NULL ? photos_base_item_get_id (item) : "(none)",
+                 share->item != NULL ? photos_base_item_get_id (share->item) : "(none)",
                  error->message);
       g_signal_emit (share->manager, signals[SHARE_ERROR], 0, share->renderer, share->item, error);
       g_error_free (error);
       goto out;
     }
 
+  g_object_unref (item); /* We already hold a ref to the item to be shared */
   g_signal_emit (share->manager, signals[SHARE_BEGAN], 0, share->renderer, share->item);
 
 out:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]