Index: trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2209)
+++ trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 2210)
@@ -75,4 +75,9 @@
     fContainer  = new TOrdCollection;
     fAutodelete = new TOrdCollection;
+
+    gROOT->GetListOfCleanups()->Add(fContainer);
+    gROOT->GetListOfCleanups()->Add(fAutodelete);
+    fContainer->SetBit(kMustCleanup);
+    fAutodelete->SetBit(kMustCleanup);
 }
 
@@ -111,4 +116,10 @@
     IsOwner() ? fContainer->SetOwner() : fAutodelete->SetOwner();
 
+    TIter Next(fContainer);
+    TObject *o;
+    while (o=Next())
+        if (o->TestBit(kCanDelete))
+            delete fContainer->Remove(o);
+
     // FIXME? If fContainer is owner do we have to remove the object
     //   from fAutodelete due to the acces when checking for a
@@ -206,4 +217,5 @@
     *fLog << inf << "Adding " << name << " to " << GetName() << "... " << flush;
 
+    cont->SetBit(kMustCleanup);
     fContainer->Add(cont);
     *fLog << "Done." << endl;
@@ -228,5 +240,8 @@
     MParContainer *cont = NULL;
     while ((cont=Next()))
+    {
+        cont->SetBit(kMustCleanup);
         AddToList(cont);
+    }
 }
 
