diff --git a/GUI/View/Scene/MaskGraphicsScene.cpp b/GUI/View/Scene/MaskGraphicsScene.cpp
index 5d34eb08ba5229581c8b79dab1ffee9d8d7bee44..5bc88256099ba228cdf8b484292ae6233341dfc1 100644
--- a/GUI/View/Scene/MaskGraphicsScene.cpp
+++ b/GUI/View/Scene/MaskGraphicsScene.cpp
@@ -383,12 +383,14 @@ void MaskGraphicsScene::updateProxyWidget()
     if (m_proxy)
         return;
 
-    m_proxy = new MaskGraphicsProxy; // TODO: check if m_proxy is released at the end
-    m_proxy->setParent(this);
     m_plot = new ColorMap; // TODO: potential memory leak
     m_plot->itemToMap(m_data_item);
+
+    m_proxy = new MaskGraphicsProxy; // TODO: check if m_proxy is released at the end
+    m_proxy->setParent(this);
     if (m_proxy->widget() != m_plot)
         m_proxy->setWidget(m_plot);
+
     addItem(m_proxy);
 }