[tracker/libtracker-sparql: 3/5] libtracker-bus: Support multiple bus connection objects



commit 9b3a125bdd0adcd42f692bdbce37d34ba11c37c0
Author: Jürg Billeter <j bitron ch>
Date:   Thu May 19 09:08:22 2011 +0200

    libtracker-bus: Support multiple bus connection objects
    
    If Tracker.Sparql.Connection.get is called after singleton is set to
    null in dispose and before backend object is finalized, multiple bus
    connection objects may exist at the same time.

 src/libtracker-bus/tracker-bus.vala |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/libtracker-bus/tracker-bus.vala b/src/libtracker-bus/tracker-bus.vala
index da32dbd..24c4f16 100644
--- a/src/libtracker-bus/tracker-bus.vala
+++ b/src/libtracker-bus/tracker-bus.vala
@@ -52,13 +52,11 @@ private interface Tracker.Bus.Statistics : DBusProxy {
 
 // Actual class definition
 public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
-	static Resources resources_object;
-	static Steroids steroids_object;
-	static Statistics statistics_object;
-	static bool initialized;
+	Resources resources_object;
+	Steroids steroids_object;
+	Statistics statistics_object;
 
-	public Connection () throws Sparql.Error, IOError, DBusError
-	requires (!initialized) {
+	public Connection () throws Sparql.Error, IOError, DBusError {
 		// FIXME: Ideally we would just get these as and when we need them
 		resources_object = GLib.Bus.get_proxy_sync (BusType.SESSION,
 		                                            TRACKER_DBUS_SERVICE,
@@ -74,12 +72,6 @@ public class Tracker.Bus.Connection : Tracker.Sparql.Connection {
 		                                             TRACKER_DBUS_SERVICE,
 		                                             TRACKER_DBUS_OBJECT_STATISTICS,
 		                                             DBusProxyFlags.DO_NOT_LOAD_PROPERTIES | DBusProxyFlags.DO_NOT_CONNECT_SIGNALS);
-
-		initialized = true;
-	}
-
-	~Connection () {
-		initialized = false;
 	}
 
 	void pipe (out UnixInputStream input, out UnixOutputStream output) throws IOError {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]