Index: /trunk/MagicSoft/Mars/mbase/MStatusArray.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusArray.cc	(revision 8282)
+++ /trunk/MagicSoft/Mars/mbase/MStatusArray.cc	(revision 8283)
@@ -247,4 +247,23 @@
 // --------------------------------------------------------------------------
 //
+// Make sure that kCanDelete is properly set for all directly contained
+// objects. Some kCanDelete bits might not be properly set or get lost when
+// the MParContainer is stored.
+//
+void MStatusArray::SetCanDelete(const TCollection *list) const
+{
+    TIter Next(list);
+    TObject *o=0;
+    while ((o=Next()))
+    {
+        if (o->InheritsFrom(TVirtualPad::Class()))
+            SetCanDelete(((TVirtualPad*)o)->GetListOfPrimitives());
+        else
+            o->SetBit(kCanDelete);
+    }
+}
+
+// --------------------------------------------------------------------------
+//
 // Switch off adding histograms to current directory before reading.
 // Switch back
@@ -252,8 +271,16 @@
 Int_t MStatusArray::Read(const char *name)
 {
+    // It seems that the contents are not properly deleted by TObjArray::Read
+    Delete();
+
+    // Make sure newly read histograms are not added to the current directory
     const Bool_t store = TH1::AddDirectoryStatus();
     TH1::AddDirectory(kFALSE);
     const Int_t rc = TObjArray::Read(name?name:"MStatusDisplay");
     TH1::AddDirectory(store);
+
+    // Make sure that all kCanDelete bits are properly set
+    SetCanDelete(this);
+
     return rc;
 }
Index: /trunk/MagicSoft/Mars/mbase/MStatusArray.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusArray.h	(revision 8282)
+++ /trunk/MagicSoft/Mars/mbase/MStatusArray.h	(revision 8283)
@@ -15,4 +15,5 @@
 {
 private:
+    void     SetCanDelete(const TCollection *list) const;
     void     PrintObjectsInPad(const TCollection *list, const TString &name, Int_t lvl=0) const;
     TObject *FindObjectInPad(TVirtualPad *pad, const char *object, TClass *base) const;
