[perl-Glib-Object-Introspection] Do not release callback memory prematurely



commit 7dd07e46e9cc9716a48a3d2a4a8250488dc5a26a
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Jun 5 17:48:23 2011 +0200

    Do not release callback memory prematurely
    
    This fixes a regression introduced in commit
    64361df305e1a22f5bd0ca2e51c9bf879e8a27cf.

 GObjectIntrospection.xs |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/GObjectIntrospection.xs b/GObjectIntrospection.xs
index ea4b339..b22eb57 100644
--- a/GObjectIntrospection.xs
+++ b/GObjectIntrospection.xs
@@ -1925,6 +1925,8 @@ release_callback (gpointer data)
 
 	if (info->data)
 		SvREFCNT_dec (info->data);
+
+	g_free (info);
 }
 
 /* ------------------------------------------------------------------------- */
@@ -2138,7 +2140,8 @@ clear_invocation_info (GPerlI11nInvocationInfo *iinfo)
 {
 	g_slist_free (iinfo->free_after_call);
 
-	g_slist_foreach (iinfo->callback_infos, (GFunc) g_free, NULL);
+	/* The actual callback infos might be needed later, so we cannot free
+	 * them here. */
 	g_slist_free (iinfo->callback_infos);
 
 	g_slist_foreach (iinfo->array_infos, (GFunc) g_free, NULL);



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