[gnome-photos] base-item: Access the internals only after IS_BASE_ITEM has passed



commit 20033375023a6698570fa20166f392bb19fd9baf
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Dec 18 13:31:42 2015 +0100

    base-item: Access the internals only after IS_BASE_ITEM has passed

 src/photos-base-item.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 0e65abe..8bebdc0 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -779,10 +779,11 @@ photos_base_item_load_buffer_async (PhotosBaseItem *self,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data)
 {
-  PhotosBaseItemPrivate *priv = self->priv;
+  PhotosBaseItemPrivate *priv;
   GTask *task;
 
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+  priv = self->priv;
 
   if (priv->load_graph == NULL)
     {
@@ -1740,10 +1741,11 @@ photos_base_item_load_async (PhotosBaseItem *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
 {
-  PhotosBaseItemPrivate *priv = self->priv;
+  PhotosBaseItemPrivate *priv;
   GTask *task;
 
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+  priv = self->priv;
 
   task = g_task_new (self, cancellable, callback, user_data);
   g_task_set_source_tag (task, photos_base_item_load_async);
@@ -1884,12 +1886,14 @@ photos_base_item_save_async (PhotosBaseItem *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
 {
-  PhotosBaseItemPrivate *priv = self->priv;
+  PhotosBaseItemPrivate *priv;
   GFile *file;
   GTask *task;
   gchar *type = NULL;
 
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+  priv = self->priv;
+
   g_return_if_fail (uri != NULL && uri[0] != '\0');
   g_return_if_fail (priv->edit_graph != NULL);
   g_return_if_fail (priv->load_graph != NULL);


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