[tracker/rss-enclosures] Fixes NB#180679: Make sure DBusGProxy is destroyed when destroying miner
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] Fixes NB#180679: Make sure DBusGProxy is destroyed when destroying miner
- Date: Wed, 24 Nov 2010 01:01:45 +0000 (UTC)
commit 7453e7f65e610073d03a051446f6fa2de41b9437
Author: Aleksander Morgado <aleksander lanedo com>
Date: Wed Jul 21 14:24:59 2010 +0200
Fixes NB#180679: Make sure DBusGProxy is destroyed when destroying miner
* It's quite a race condition, but could happen that the miner object
gets fully disposed, but the DBusGProxy was still alive as there was
an extra reference of it. In this case, if receiving a new message
in the filter for NameOwnerChanged, we were calling g_object_get_qdata()
on an already destroyed GObject.
src/libtracker-miner/tracker-dbus.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-dbus.c b/src/libtracker-miner/tracker-dbus.c
index 1a3b7dd..be6e32b 100644
--- a/src/libtracker-miner/tracker-dbus.c
+++ b/src/libtracker-miner/tracker-dbus.c
@@ -206,12 +206,14 @@ dbus_data_create (TrackerMiner *miner,
/* Now we're successfully connected and registered, create the data */
data = g_slice_new0 (DBusData);
+ /* Connection object is a shared one, so we need to keep our own
+ * reference to it */
data->connection = dbus_g_connection_ref (connection);
- data->gproxy = g_object_ref (gproxy);
- data->name_monitors = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- (GDestroyNotify) g_free,
- NULL);
+ data->gproxy = gproxy;
+ data->name_monitors = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ (GDestroyNotify) g_free,
+ NULL);
return data;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]