[telepathy-glib/master] Annotate an intentional one-per-process leak
Simon McVittie
simon.mcvittie at collabora.co.uk
Thu Dec 3 11:06:55 PST 2009
---
telepathy-glib/dbus-daemon.c | 4 ++++
tools/telepathy-glib.supp | 10 ++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/telepathy-glib/dbus-daemon.c b/telepathy-glib/dbus-daemon.c
index 2e6a324..320a1a5 100644
--- a/telepathy-glib/dbus-daemon.c
+++ b/telepathy-glib/dbus-daemon.c
@@ -1213,6 +1213,9 @@ free_daemon_list (gpointer p)
g_slice_free (GSList *, slistp);
}
+/* If you add more slice-allocation in this function, make the suppression
+ * "tp_dbus_daemon_constructor @daemons once per DBusConnection" in
+ * telepathy-glib.supp more specific. */
static GObject *
tp_dbus_daemon_constructor (GType type,
guint n_params,
@@ -1240,6 +1243,7 @@ tp_dbus_daemon_constructor (GType type,
if (daemons == NULL)
{
+ /* This slice is never freed; it's a one-per-DBusConnection leak. */
daemons = g_slice_new (GSList *);
*daemons = NULL;
diff --git a/tools/telepathy-glib.supp b/tools/telepathy-glib.supp
index cbf9d36..834e7b8 100644
--- a/tools/telepathy-glib.supp
+++ b/tools/telepathy-glib.supp
@@ -137,6 +137,16 @@
fun:dbus_g_bus_get
}
+# ============================= telepathy-glib ========================
+
+{
+ tp_dbus_daemon_constructor @daemons once per DBusConnection
+ Memcheck:Leak
+ ...
+ fun:g_slice_alloc
+ fun:tp_dbus_daemon_constructor
+}
+
# ============================= unclassified ==========================
{
--
1.5.6.5
More information about the telepathy-commits
mailing list