From d5003c97e7acde1322fd9c400aa5cbfd98f7293a Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Tue, 18 Aug 2026 21:39:32 +0800 Subject: [PATCH] Make plugin page registration idempotent Signed-off-by: Loren Eteval --- Furious/Service/PluginUIManager.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Furious/Service/PluginUIManager.py b/Furious/Service/PluginUIManager.py index d958e0e9..f0740116 100644 --- a/Furious/Service/PluginUIManager.py +++ b/Furious/Service/PluginUIManager.py @@ -26,6 +26,7 @@ from Furious.Plugins import ( getPluginRegistry, ) +from PySide6 import QtCore from PySide6.QtWidgets import QWidget import logging @@ -54,9 +55,15 @@ class PluginNavigationManager: """Initialize with the process-wide registry unless one is supplied.""" self.registry = registry or getPluginRegistry() self._pages = [] + self._registrationAttempted = False def registerPages(self, navigationView): """Register plugin pages in stable plugin/provider/order sequence.""" + if self._registrationAttempted: + return tuple(self._pages) + + self._registrationAttempted = True + contributions = [] for plugin in self.registry.plugins(): @@ -102,6 +109,9 @@ class PluginNavigationManager: if not isinstance(page, QWidget): logger.error(f'plugin page {pageId!r} did not create a QWidget') + if isinstance(page, QtCore.QObject): + page.deleteLater() + continue try: