Changeset 11733 for trunk


Ignore:
Timestamp:
07/31/11 12:04:44 (13 years ago)
Author:
tbretz
Message:
Move dimInfo in the service list at the last position to ensure that it is destroyed first; adapted arguments of RemoveService.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/datalogger.cc

    r11719 r11733  
    138138    Fits    runFile;
    139139#endif
    140     ///the actual dimInfo pointer
    141     shared_ptr<DimStampedInfo> dimInfo;
    142140    ///the server
    143141    string server;
     
    153151    bool fitsBufferAllocated;
    154152
     153    ///the actual dimInfo pointer (must be the last in the list to ensure
     154    /// that it is the first which is deleted -- and consequently none of
     155    /// the other members can still be in use in an infoHandler)
     156    shared_ptr<DimStampedInfo> dimInfo;
     157
    155158    ///Dim info constructor
    156159    SubscriptionType(DimStampedInfo* info=NULL)
    157160    {
    158         dimInfo = shared_ptr<DimStampedInfo>(info);
    159161        fConv = shared_ptr<Converter>();
    160162        runNumber = 0;
    161163        lastReceivedEvent = Time::None;
    162164        fitsBufferAllocated = false;
     165
     166        // Should be the last instantiated to make sure that all other
     167        // variables which might be used are already initialized
     168        dimInfo = shared_ptr<DimStampedInfo>(info);
    163169    }
    164170
     
    360366    void AddService(const string&, const string&, const string&, bool);
    361367    ///Remove a given service subscription
    362     void RemoveService(const string&, const string&, bool);
     368    void RemoveService(const string, const string, bool);
    363369    ///Remove all the services associated with a given server
    364370    void RemoveAllServices(const string&);
     
    516522//! @param isCmd whether or not this is a command
    517523//
    518 void DataLogger::RemoveService(const string& server, const string& service, bool isCmd)
     524void DataLogger::RemoveService(string server, string service, bool isCmd)
    519525{
    520526    if (fDestructing)//this function is called by the super class, after the destructor has deleted its own subscriptions
     
    962968//    }
    963969
    964 //    dim_lock();
    965970
    966971    //now clear the services subscriptions
Note: See TracChangeset for help on using the changeset viewer.