From 9668409341d184904a3efbe4907f1377d26bef15 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Thu, 28 Dec 2023 23:00:42 +0100
Subject: [PATCH] sort

---
 GUI/View/Scene/MaskGraphicsScene.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/GUI/View/Scene/MaskGraphicsScene.cpp b/GUI/View/Scene/MaskGraphicsScene.cpp
index 5d34eb08ba5..5bc88256099 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);
 }
 
-- 
GitLab