Bug 20946 - Closed D-Bus and GObject signals fired together make code nasty
Summary: Closed D-Bus and GObject signals fired together make code nasty
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-30 06:29 UTC by Guillaume Desmottes
Modified: 2019-12-03 19:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Guillaume Desmottes 2009-03-30 06:29:25 UTC
Channels have to fire the D-Bus Closed signal when disposing (if the channel was not already closed of course). Most of the channel managers catch the GObject closed signal so they can drop their ref when the channel has been closed.

Currently all the channels mgr do this kind of trick when closing all the channels:
      GHashTable *tmp = priv->tubes_channels;
      priv->tubes_channels = NULL;
      g_hash_table_destroy (tmp);

So the closed callback knows we are disposing and do nothing.

We could avoid these hacks by not firing the GObject signal when disposing.  
Unfortunately that's currently not possible.
Comment 1 Simon McVittie 2009-04-23 09:42:24 UTC
Can't fix. dbus-glib emits (D-Bus) Closed as a side-effect of (GObject) closed.
Comment 2 Will Thompson 2009-07-27 06:23:47 UTC
After further thought, I think the correct fix here is to change:

      GHashTable *tmp = priv->tubes_channels;
      priv->tubes_channels = NULL;
      g_hash_table_destroy (tmp);

into:

      GList *cs = g_hash_table_get_values (priv->tubes_channels);
      for (TubeChannel *c in cs)
          tube_channel_close (c);
      g_list_free (cs);
      g_assert (g_hash_table_size (priv->tubes_channels) == 0);

The issue is in conflating unreffing the channel with telling it to close. INVALID?
Comment 3 GitLab Migration User 2019-12-03 19:23:13 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/12.


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.