[librsvg: 3/5] Don't chain calls to finish_load() and the function whose result it depends on



commit 5a5c4a55ae293cd24e2bc303fd61734c50eb6fe5
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Sep 13 09:07:38 2018 -0500

    Don't chain calls to finish_load() and the function whose result it depends on

 librsvg/rsvg-handle.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/librsvg/rsvg-handle.c b/librsvg/rsvg-handle.c
index 790b7e70..72bcf492 100644
--- a/librsvg/rsvg-handle.c
+++ b/librsvg/rsvg-handle.c
@@ -705,6 +705,7 @@ gboolean
 rsvg_handle_close (RsvgHandle *handle, GError **error)
 {
     RsvgHandlePrivate *priv;
+    gboolean read_successfully;
     gboolean result;
 
     rsvg_return_val_if_fail (handle, FALSE, error);
@@ -716,7 +717,8 @@ rsvg_handle_close (RsvgHandle *handle, GError **error)
         return TRUE;
     }
 
-    result = finish_load (handle, rsvg_load_close (priv->load, error));
+    read_successfully = rsvg_load_close (priv->load, error);
+    result = finish_load (handle, read_successfully);
 
     return result;
 }
@@ -747,6 +749,7 @@ rsvg_handle_read_stream_sync (RsvgHandle   *handle,
                               GError      **error)
 {
     RsvgHandlePrivate *priv;
+    gboolean read_successfully;
     gboolean result;
     RsvgLoad *saved_load;
 
@@ -764,7 +767,9 @@ rsvg_handle_read_stream_sync (RsvgHandle   *handle,
     saved_load = priv->load;
 
     priv->load = rsvg_load_new (handle, (priv->flags & RSVG_HANDLE_FLAG_UNLIMITED) != 0);
-    result = finish_load (handle, rsvg_load_read_stream_sync (priv->load, stream, cancellable, error));
+
+    read_successfully = rsvg_load_read_stream_sync (priv->load, stream, cancellable, error);
+    result = finish_load (handle, read_successfully);
 
     priv->load = saved_load;
 


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