summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2005-06-20 19:54:22 +0000
committerColin Walters <walters@verbum.org>2005-06-20 19:54:22 +0000
commit7883563478cefd0eb7a4f4466904dcec46db6d8d (patch)
treea1d6406101aa1e1b9aa08a630cd5dec35c1e676d /glib
parent6a4596752c074fbfd10eec0462d6a3f7ac62dfc8 (diff)
downloaddbus-7883563478cefd0eb7a4f4466904dcec46db6d8d.tar.gz
2005-06-20 Colin Walters <walters@verbum.org>
Patch suggested by Ross Burton <ross@openedhand.com> * glib/dbus-gobject.c (export_signals): Free signal name. (g_value_init): Use G_VALUE_NOCOPY_CONTENTS to plug memory leak. Add a bit of documentation. (dbus_g_method_return_error): Free context, and note we do so.
Diffstat (limited to 'glib')
-rw-r--r--glib/dbus-gobject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/glib/dbus-gobject.c b/glib/dbus-gobject.c
index 370862f3..80766ad0 100644
--- a/glib/dbus-gobject.c
+++ b/glib/dbus-gobject.c
@@ -1245,6 +1245,7 @@ export_signals (DBusGConnection *connection, const DBusGObjectInfo *info, GObjec
g_closure_add_finalize_notifier (closure, NULL,
dbus_g_signal_closure_finalize);
+ g_free (s);
}
}
@@ -1549,6 +1550,7 @@ dbus_g_object_register_marshaller_array (GClosureMarshal marshaller,
/**
* Send a return message for a given method invocation, with arguments.
+ * This function also frees the sending context.
*
* @param context the method context
*/
@@ -1575,7 +1577,7 @@ dbus_g_method_return (DBusGMethodInvocation *context, ...)
char *error;
g_value_init (&value, g_array_index (argsig, GType, i));
error = NULL;
- G_VALUE_COLLECT (&value, args, 0, &error);
+ G_VALUE_COLLECT (&value, args, G_VALUE_NOCOPY_CONTENTS, &error);
if (error)
{
g_warning(error);
@@ -1595,6 +1597,7 @@ dbus_g_method_return (DBusGMethodInvocation *context, ...)
/**
* Send a error message for a given method invocation.
+ * This function also frees the sending context.
*
* @param context the method context
* @param error the error to send.
@@ -1606,6 +1609,7 @@ dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error)
reply = gerror_to_dbus_error_message (context->object, dbus_g_message_get_message (context->message), error);
dbus_connection_send (dbus_g_connection_get_connection (context->connection), reply, NULL);
dbus_message_unref (reply);
+ g_free (context);
}
/** @} */ /* end of public API */