diff --git a/CHANGELOG.md b/CHANGELOG.md index f8164a88..c317a0cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +23.11.2021 + +- added a few protections against RuntimeError exceptions that randomly popup due of wrapped C++ objects being deleted + 22.11.2021 - in AppTextEditor made some changes (added some placeholders and a message popup when reaching the end of document) diff --git a/appObjects/FlatCAMObj.py b/appObjects/FlatCAMObj.py index 1890c1c1..0e1d44f5 100644 --- a/appObjects/FlatCAMObj.py +++ b/appObjects/FlatCAMObj.py @@ -312,7 +312,13 @@ class FlatCAMObj(QtCore.QObject): except Exception as e: self.app.log.error("FlatCAMObj.build_ui() --> Nothing to remove: %s" % str(e)) - self.app.ui.properties_scroll_area.setWidget(self.ui) + try: + self.app.ui.properties_scroll_area.setWidget(self.ui) + except RuntimeError: + try: + self.app.ui.properties_scroll_area.setWidget(self.ui) + except Exception: + pass # self.ui.setMinimumWidth(100) # self.ui.setMaximumWidth(self.app.ui.properties_tab.sizeHint().width()) diff --git a/app_Main.py b/app_Main.py index d64cd0f3..f28959a6 100644 --- a/app_Main.py +++ b/app_Main.py @@ -8443,7 +8443,10 @@ class App(QtCore.QObject): if self.ui.notebook.tabText(self.ui.notebook.currentIndex()) == _("Properties"): active_obj = self.collection.get_active() if active_obj: - active_obj.build_ui() + try: + active_obj.build_ui() + except Exception: + self.setup_default_properties_tab() else: self.setup_default_properties_tab()