Skip to content

Commit

Permalink
Re #5466. A member variable wasn't being initialised.
Browse files Browse the repository at this point in the history
This was leading to a likely memory leak in the EventWorkspace MRU list.
  • Loading branch information
RussellTaylor committed Jun 15, 2012
1 parent 39699fe commit 85a7225
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Code/Mantid/Framework/DataObjects/src/EventList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace DataObjects

/// Constructor (empty)
EventList::EventList() :
eventType(TOF), order(UNSORTED), mru(NULL)
eventType(TOF), order(UNSORTED), mru(NULL), m_lockedMRU(false)
{
}

Expand All @@ -85,15 +85,15 @@ namespace DataObjects
*/
EventList::EventList(EventWorkspaceMRU * mru, specid_t specNo)
: IEventList(specNo),
eventType(TOF), order(UNSORTED), mru(mru)
eventType(TOF), order(UNSORTED), mru(mru), m_lockedMRU(false)
{
}


/** Constructor copying from an existing event list
* @param rhs :: EventList object to copy*/
EventList::EventList(const EventList& rhs)
: IEventList(rhs), mru(rhs.mru)
: IEventList(rhs), mru(rhs.mru), m_lockedMRU(false)
{
//Call the copy operator to do the job,
this->operator=(rhs);
Expand All @@ -102,6 +102,7 @@ namespace DataObjects
/** Constructor, taking a vector of events.
* @param events :: Vector of TofEvent's */
EventList::EventList(const std::vector<TofEvent> &events)
: mru(NULL), m_lockedMRU(false)
{
this->events.assign(events.begin(), events.end());
this->eventType = TOF;
Expand All @@ -111,6 +112,7 @@ namespace DataObjects
/** Constructor, taking a vector of events.
* @param events :: Vector of WeightedEvent's */
EventList::EventList(const std::vector<WeightedEvent> &events)
: mru(NULL), m_lockedMRU(false)
{
this->weightedEvents.assign(events.begin(), events.end());
this->eventType = WEIGHTED;
Expand All @@ -120,6 +122,7 @@ namespace DataObjects
/** Constructor, taking a vector of events.
* @param events :: Vector of WeightedEventNoTime's */
EventList::EventList(const std::vector<WeightedEventNoTime> &events)
: mru(NULL), m_lockedMRU(false)
{
this->weightedEventsNoTime.assign(events.begin(), events.end());
this->eventType = WEIGHTED_NOTIME;
Expand Down

0 comments on commit 85a7225

Please sign in to comment.