Changeset 8283 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 02/01/07 12:49:29 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MStatusArray.cc
r7784 r8283 247 247 // -------------------------------------------------------------------------- 248 248 // 249 // Make sure that kCanDelete is properly set for all directly contained 250 // objects. Some kCanDelete bits might not be properly set or get lost when 251 // the MParContainer is stored. 252 // 253 void MStatusArray::SetCanDelete(const TCollection *list) const 254 { 255 TIter Next(list); 256 TObject *o=0; 257 while ((o=Next())) 258 { 259 if (o->InheritsFrom(TVirtualPad::Class())) 260 SetCanDelete(((TVirtualPad*)o)->GetListOfPrimitives()); 261 else 262 o->SetBit(kCanDelete); 263 } 264 } 265 266 // -------------------------------------------------------------------------- 267 // 249 268 // Switch off adding histograms to current directory before reading. 250 269 // Switch back … … 252 271 Int_t MStatusArray::Read(const char *name) 253 272 { 273 // It seems that the contents are not properly deleted by TObjArray::Read 274 Delete(); 275 276 // Make sure newly read histograms are not added to the current directory 254 277 const Bool_t store = TH1::AddDirectoryStatus(); 255 278 TH1::AddDirectory(kFALSE); 256 279 const Int_t rc = TObjArray::Read(name?name:"MStatusDisplay"); 257 280 TH1::AddDirectory(store); 281 282 // Make sure that all kCanDelete bits are properly set 283 SetCanDelete(this); 284 258 285 return rc; 259 286 } -
trunk/MagicSoft/Mars/mbase/MStatusArray.h
r7808 r8283 15 15 { 16 16 private: 17 void SetCanDelete(const TCollection *list) const; 17 18 void PrintObjectsInPad(const TCollection *list, const TString &name, Int_t lvl=0) const; 18 19 TObject *FindObjectInPad(TVirtualPad *pad, const char *object, TClass *base) const;
Note:
See TracChangeset
for help on using the changeset viewer.