After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777269 - gxps-file: use GPtrArray for the docs in an archive
gxps-file: use GPtrArray for the docs in an archive
Status: RESOLVED FIXED
Product: libgxps
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libgxps maintainers
libgxps maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-15 11:19 UTC by Paolo Borelli
Modified: 2017-01-16 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gxps-file: use GPtrArray for the docs in an archive (3.43 KB, patch)
2017-01-15 11:19 UTC, Paolo Borelli
committed Details | Review

Description Paolo Borelli 2017-01-15 11:19:26 UTC
The API exposes get_n and get_nth so using an array internally
is simpler and more efficient.
Comment 1 Paolo Borelli 2017-01-15 11:19:29 UTC
Created attachment 343495 [details] [review]
gxps-file: use GPtrArray for the docs in an archive
Comment 2 Carlos Garcia Campos 2017-01-16 15:46:59 UTC
Review of attachment 343495 [details] [review]:

Cool, thanks!

::: libgxps/gxps-file.c
@@ +330,3 @@
 	xps->priv->initialized = TRUE;
 
+	xps->priv->docs = g_ptr_array_new_with_free_func ((GDestroyNotify)g_free);

I don't think you need to cast here.
Comment 3 Paolo Borelli 2017-01-16 18:19:43 UTC
Comment on attachment 343495 [details] [review]
gxps-file: use GPtrArray for the docs in an archive

Amended as requested and pushed.
Comment 4 Paolo Borelli 2017-01-16 18:19:54 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.