summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2012-02-16 15:17:03 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2012-02-16 15:17:03 +0100
commit046dd93cb65e7a3957ba6d6104cdb10c311c15fa (patch)
tree6b22f05a1307fef861b91153114ae308b7d070fe
parenta305a331e1041132b77e2ad28a57099862f3c423 (diff)
Fix transfer annotations for GPtrArray returns
We use g_ptr_array_new_with_free_func(), so the returned GPtrArrays own the items and will free them. Thus transfer ownership needs to be "container", not "full", otherwise we'll get crashes due to double-free'ing. https://bugzilla.gnome.org/show_bug.cgi?id=670216
-rw-r--r--lib/packagekit-glib2/pk-desktop.c4
-rw-r--r--lib/packagekit-glib2/pk-results.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/packagekit-glib2/pk-desktop.c b/lib/packagekit-glib2/pk-desktop.c
index 75c8bf23..85e475a9 100644
--- a/lib/packagekit-glib2/pk-desktop.c
+++ b/lib/packagekit-glib2/pk-desktop.c
@@ -101,7 +101,7 @@ pk_desktop_sqlite_package_cb (void *data, gint argc, gchar **argv, gchar **col_n
* Return all desktop files owned by a package, regardless if they are shown
* in the main menu or not.
*
- * Return value: (transfer full): string array of results, free with g_ptr_array_unref()
+ * Return value: (transfer container): string array of results, free with g_ptr_array_unref()
*
* Since: 0.5.3
**/
@@ -144,7 +144,7 @@ out:
* Return all desktop files owned by a package that would be shown in a menu,
* i.e are an application
*
- * Return value: (transfer full): string array of results, free with g_ptr_array_unref()
+ * Return value: (transfer container): string array of results, free with g_ptr_array_unref()
*
* Since: 0.5.3
**/
diff --git a/lib/packagekit-glib2/pk-results.c b/lib/packagekit-glib2/pk-results.c
index 06a9f8b1..791b1b72 100644
--- a/lib/packagekit-glib2/pk-results.c
+++ b/lib/packagekit-glib2/pk-results.c
@@ -536,7 +536,7 @@ pk_results_get_error_code (PkResults *results)
*
* Gets the packages from the transaction.
*
- * Return value: (element-type PkPackage) (transfer full): A #GPtrArray array of #PkPackage's, free with g_ptr_array_unref().
+ * Return value: (element-type PkPackage) (transfer container): A #GPtrArray array of #PkPackage's, free with g_ptr_array_unref().
*
* Since: 0.5.2
**/