[librsvg] rsvg_load_read_stream_sync(): Untangle a bit so we can port to Rust



commit b07cdb861b0b90d3ecede240588975910d88cadf
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Dec 7 10:43:35 2018 -0600

    rsvg_load_read_stream_sync(): Untangle a bit so we can port to Rust

 librsvg/rsvg-load.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/librsvg/rsvg-load.c b/librsvg/rsvg-load.c
index 3c2a3acc..b15e4f95 100644
--- a/librsvg/rsvg-load.c
+++ b/librsvg/rsvg-load.c
@@ -239,12 +239,11 @@ rsvg_load_read_stream_sync (RsvgLoad     *load,
                             GError      **error)
 {
     GError *err = NULL;
-    gboolean res;
+    gboolean res = FALSE;
 
     stream = rsvg_get_input_stream_for_loading (stream, cancellable, error);
     if (stream == NULL) {
-        load->state = LOAD_STATE_CLOSED;
-        return FALSE;
+        goto out;
     }
 
     g_assert (load->xml.ctxt == NULL);
@@ -260,6 +259,10 @@ rsvg_load_read_stream_sync (RsvgLoad     *load,
 
     g_object_unref (stream);
 
+out:
+
+    load->state = LOAD_STATE_CLOSED;
+
     return res;
 }
 


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