Changeset 19334


Ignore:
Timestamp:
Oct 30, 2018, 3:53:57 PM (5 months ago)
Author:
tbretz
Message:
Make sure that if root decides to delete TFormula we are not deleting it again.
Location:
trunk/Mars/mdata
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mdata/MDataPhrase.cc

    r19258 r19334  
    425425}
    426426
     427void MDataPhrase::RecursiveRemove(TObject *obj)
     428{
     429    if (fFormula==obj)
     430        fFormula = NULL;
     431}
     432
     433
    427434// --------------------------------------------------------------------------
    428435//
     
    441448
    442449    fFormula = new TFormula;
     450    fFormula->SetBit(kMustCleanup);
    443451
    444452    // Must have a name otherwise all axis labels disappear like a miracle
     
    517525    if (rule)
    518526        SetRule(rule);
     527
     528    // Make sure that all object deleted are also deleted from this list
     529    gROOT->GetListOfCleanups()->Add(this);
     530    // Make sure that this doesn't remain in ListOfCleanups after deletion
     531    SetBit(kMustCleanup);
    519532}
    520533
     
    541554
    542555    fFormula = f ? (TFormula*)f->Clone() : 0;
     556    fFormula->SetBit(kMustCleanup);
    543557    gROOT->GetListOfFunctions()->Remove(fFormula);
    544558
     
    549563    while ((o=Next()))
    550564        fMembers.AddLast(o->Clone());
     565
     566    // Make sure that all object deleted are also deleted from this list
     567    gROOT->GetListOfCleanups()->Add(this);
     568    // Make sure that this doesn't remain in ListOfCleanups after deletion
     569    SetBit(kMustCleanup);
    551570}
    552571
  • trunk/Mars/mdata/MDataPhrase.h

    r8907 r19334  
    3636    // TObject
    3737    void     Clear(Option_t *o="");
     38    void     RecursiveRemove(TObject *obj);
    3839
    3940    // MParContainer
Note: See TracChangeset for help on using the changeset viewer.