[vala] D-Bus: Fix memory leak in introspection handler



commit 0b50752b1b270cd1de7f0e9017d058d1517cb33b
Author: Jürg Billeter <j bitron ch>
Date:   Wed Apr 8 19:29:44 2009 +0200

    D-Bus: Fix memory leak in introspection handler
---
 gobject/valadbusservermodule.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gobject/valadbusservermodule.vala b/gobject/valadbusservermodule.vala
index c9c2643..936d33a 100644
--- a/gobject/valadbusservermodule.vala
+++ b/gobject/valadbusservermodule.vala
@@ -1067,6 +1067,10 @@ internal class Vala.DBusServerModule : DBusClientModule {
 		cfor.add_iterator (new CCodeUnaryExpression (CCodeUnaryOperator.POSTFIX_INCREMENT, new CCodeIdentifier ("i")));
 		block.add_statement (cfor);
 
+		var list_free_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_free_string_array"));
+		list_free_call.add_argument (new CCodeIdentifier ("children"));
+		block.add_statement (new CCodeExpressionStatement (list_free_call));
+
 		xml_data = "</node>\n";
 		str_call = new CCodeFunctionCall (new CCodeIdentifier ("g_string_append"));
 		str_call.add_argument (new CCodeIdentifier ("xml_data"));



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