Index: /trunk/FACT++/src/datalogger.cc
===================================================================
--- /trunk/FACT++/src/datalogger.cc	(revision 11732)
+++ /trunk/FACT++/src/datalogger.cc	(revision 11733)
@@ -138,6 +138,4 @@
     Fits    runFile;
 #endif
-    ///the actual dimInfo pointer
-    shared_ptr<DimStampedInfo> dimInfo;
     ///the server
     string server;
@@ -153,12 +151,20 @@
     bool fitsBufferAllocated;
 
+    ///the actual dimInfo pointer (must be the last in the list to ensure
+    /// that it is the first which is deleted -- and consequently none of
+    /// the other members can still be in use in an infoHandler)
+    shared_ptr<DimStampedInfo> dimInfo;
+
     ///Dim info constructor
     SubscriptionType(DimStampedInfo* info=NULL)
     {
-        dimInfo = shared_ptr<DimStampedInfo>(info);
         fConv = shared_ptr<Converter>();
         runNumber = 0;
         lastReceivedEvent = Time::None;
         fitsBufferAllocated = false;
+
+        // Should be the last instantiated to make sure that all other
+        // variables which might be used are already initialized
+        dimInfo = shared_ptr<DimStampedInfo>(info);
     }
 
@@ -360,5 +366,5 @@
     void AddService(const string&, const string&, const string&, bool);
     ///Remove a given service subscription
-    void RemoveService(const string&, const string&, bool);
+    void RemoveService(const string, const string, bool);
     ///Remove all the services associated with a given server
     void RemoveAllServices(const string&);
@@ -516,5 +522,5 @@
 //! @param isCmd whether or not this is a command
 //
-void DataLogger::RemoveService(const string& server, const string& service, bool isCmd)
+void DataLogger::RemoveService(string server, string service, bool isCmd)
 {
     if (fDestructing)//this function is called by the super class, after the destructor has deleted its own subscriptions
@@ -962,5 +968,4 @@
 //    }
 
-//    dim_lock();
 
     //now clear the services subscriptions
