diff -r b00fee34ea40 -r 52e30cc024aa src/eric7/WebBrowser/WebBrowserWindow.py --- a/src/eric7/WebBrowser/WebBrowserWindow.py Fri Mar 21 16:27:43 2025 +0100 +++ b/src/eric7/WebBrowser/WebBrowserWindow.py Fri Mar 21 16:29:08 2025 +0100 @@ -352,6 +352,8 @@ self.__initWebEngineSettings() + self.__editors = [] + # initialize some of our class objects self.passwordManager() self.historyManager() @@ -3263,6 +3265,10 @@ self.__isClosing = True + for editor in self.__editors[:]: + with contextlib.suppress(RuntimeError): + editor.close() + if ( not WebBrowserWindow._performingShutdown and len(WebBrowserWindow.BrowserWindows) == 1 @@ -4346,11 +4352,25 @@ """ from eric7.QScintilla.MiniEditor import MiniEditor - editor = MiniEditor(parent=self) + editor = MiniEditor() + editor.closing.connect(lambda: self.__editorClosing(editor)) editor.setText(src, "Html") editor.setLanguage("dummy.html") editor.show() + self.__editors.append(editor) + + def __editorClosing(self, editor): + """ + Private method called, when an editor is closing. + + @param editor reference to the closing editor + @type MiniEditor + """ + with contextlib.suppress(ValueError): + self.__editors.remove(editor) + del editor + @pyqtSlot() def __toggleJavaScriptConsole(self): """