Bug 32116 - TpBaseConnectionManager leaks legacy protocol objects
Summary: TpBaseConnectionManager leaks legacy protocol objects
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: 0.12
Hardware: Other All
: medium trivial
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-12-05 13:21 UTC by Olli Salli
Modified: 2010-12-06 08:21 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Olli Salli 2010-12-05 13:21:52 UTC
tp_base_connection_manager_register does:

  if (cls->protocol_params != NULL)
    {
      for (i = 0; cls->protocol_params[i].name != NULL; i++)
        {
          tp_base_connection_manager_add_protocol (self,
              _tp_legacy_protocol_new (self, cls->protocol_params + i));
        }
    }

and add_protocol does:

  g_hash_table_insert (self->priv->protocols,
      g_strdup (tp_base_protocol_get_name (protocol)),
      g_object_ref (protocol));

and obviously, there is just one unref in total, from the value destructor specified when creating the protocols hash table. I guess the protocol object can't be made GInitiallyUnowned; just unref the protocol manually using a temp var in register()?
Comment 1 Simon McVittie 2010-12-06 02:05:14 UTC
Also affects the 0.12 stable branch. Not problematic in practice, since in a real CM, the TpBaseConnectionManager subclass is constructed during initialization and not released until the process exits.
Comment 2 Simon McVittie 2010-12-06 02:16:03 UTC
This seems to work.
Comment 3 Jonny Lamb 2010-12-06 06:53:45 UTC
wowzer
Comment 4 Simon McVittie 2010-12-06 08:21:26 UTC
Fixed in git for 0.12.6 and 0.13.9.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.