From bf39b91c6a623bc52ae3eed98500b1cc03ed8e6c Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Fri, 21 Mar 2025 08:44:28 +0100 Subject: [PATCH 1/2] addresses the issue 2422 in pyFAI: https://github.com/silx-kit/pyFAI/issues/2422 --- src/silx/gui/dialog/AbstractDataFileDialog.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/silx/gui/dialog/AbstractDataFileDialog.py b/src/silx/gui/dialog/AbstractDataFileDialog.py index 00db27509e..45b7effe4e 100644 --- a/src/silx/gui/dialog/AbstractDataFileDialog.py +++ b/src/silx/gui/dialog/AbstractDataFileDialog.py @@ -640,8 +640,12 @@ def _clear(self): self.__directory = self.directory() self.__browser.clear() self.__closeFile() - self.__fileModel = None - self.__dataModel = None + if self.__fileModel is not None: + self.__fileModel.deleteLater() + self.__fileModel = None + if self.__dataModel is not None: + self.__dataModel.deleteLater() + self.__dataModel = None def hasPendingEvents(self): """Returns true if the dialog have asynchronous tasks working on the From 2ef9c64d1fde39247cc482a43b7dd884c99b68ff Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Mon, 24 Mar 2025 08:26:16 +0100 Subject: [PATCH 2/2] Simplify AbstractDataFileDialog.py --- src/silx/gui/dialog/AbstractDataFileDialog.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/silx/gui/dialog/AbstractDataFileDialog.py b/src/silx/gui/dialog/AbstractDataFileDialog.py index 45b7effe4e..25dfcf5b08 100644 --- a/src/silx/gui/dialog/AbstractDataFileDialog.py +++ b/src/silx/gui/dialog/AbstractDataFileDialog.py @@ -640,9 +640,7 @@ def _clear(self): self.__directory = self.directory() self.__browser.clear() self.__closeFile() - if self.__fileModel is not None: - self.__fileModel.deleteLater() - self.__fileModel = None + self.__fileModel = None if self.__dataModel is not None: self.__dataModel.deleteLater() self.__dataModel = None