diff --git a/core/qa/CbmQaCanvas.h b/core/qa/CbmQaCanvas.h
index d88209aa46c6daa2588a8700512b98171b4d5d06..d24d08a3b3ae681892d847d2b3c8626363f95dcf 100644
--- a/core/qa/CbmQaCanvas.h
+++ b/core/qa/CbmQaCanvas.h
@@ -48,6 +48,10 @@ private:
   /// Constructor which calls TCanvas constructor and restores the bach mode
   template<typename... Types>
   CbmQaCanvas(MyBoolean oldBatchMode, Types... args) : TCanvas(args...) {
+    // prevent automatic deletion of this canvas
+    // when another canvas with the same name is created somewhere else
+    gROOT->GetListOfCanvases()->Remove(this);
+    // reset the batch mode to its original value
     gROOT->SetBatch((Bool_t) oldBatchMode);
   }