[libgsf] OpenPkg: fix generated index.



commit 6d2102f9c21eefdecf332800e85a0d8516f85fe7
Author: Morten Welinder <terra gnome org>
Date:   Mon Feb 9 10:24:16 2015 -0500

    OpenPkg: fix generated index.

 ChangeLog                |    5 +++++
 gsf/gsf-open-pkg-utils.c |   15 +++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index afa69f7..75211d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-09  Morten Welinder  <terra gnome org>
+
+       * gsf/gsf-open-pkg-utils.c (gsf_open_pkg_write_content_override):
+       Release children here, not in gsf_outfile_open_pkg_close.
+
 2015-02-08  Morten Welinder  <terra gnome org>
 
        * gsf/gsf-open-pkg-utils.c (gsf_outfile_open_pkg_close): Plug
diff --git a/gsf/gsf-open-pkg-utils.c b/gsf/gsf-open-pkg-utils.c
index 09eed7d..7cbb687 100644
--- a/gsf/gsf-open-pkg-utils.c
+++ b/gsf/gsf-open-pkg-utils.c
@@ -609,16 +609,15 @@ gsf_open_pkg_write_content_default (GsfXMLOut *xml, char const *ext, char const
        gsf_xml_out_end_element (xml); /* </Default> */
 }
 static void
-gsf_open_pkg_write_content_override (GsfOutfileOpenPkg const *open_pkg,
+gsf_open_pkg_write_content_override (GsfOutfileOpenPkg *open_pkg,
                                     char const *base,
                                     GsfXMLOut *xml)
 {
-       GsfOutfileOpenPkg const *child;
-       char   *path;
        GSList *ptr;
 
        for (ptr = open_pkg->children ; ptr != NULL ; ptr = ptr->next) {
-               child = ptr->data;
+               GsfOutfileOpenPkg *child = ptr->data;
+               char *path;
                if (child->is_dir) {
                        path = g_strconcat (base, gsf_output_name (GSF_OUTPUT (child)), "/", NULL);
                        gsf_open_pkg_write_content_override (child, path, xml);
@@ -634,6 +633,10 @@ gsf_open_pkg_write_content_override (GsfOutfileOpenPkg const *open_pkg,
                }
                g_free (path);
        }
+
+       /* Dispose of children here to break link cycles.  */
+       g_slist_free_full (open_pkg->children, g_object_unref);
+       open_pkg->children = NULL;
 }
 
 static gboolean
@@ -723,10 +726,6 @@ gsf_outfile_open_pkg_close (GsfOutput *output)
        if (NULL == gsf_output_name (output))
                return gsf_output_close (open_pkg->sink);
 
-       /* Dispose of children here to break link cycles.  */
-       g_slist_free_full (open_pkg->children, g_object_unref);
-       open_pkg->children = NULL;
-
        return res;
 }
 


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