Skip to content

Commit

Permalink
Expand the circumstances under which we expect the C++ object to be g…
Browse files Browse the repository at this point in the history
…one.

This was uncovered after caching, but might've existed before; that extra update function that's now within the try could _also_ call the emitters, causing the same problem for which the existing try-catches where made.

CURA-12190
  • Loading branch information
rburema committed Oct 15, 2024
1 parent d78dc50 commit 1cea1cd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions UM/Settings/Models/SettingPropertyProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,16 @@ def _onPropertiesChanged(self, key: str, property_names: List[str]) -> None:
# logic to emit pyqtSignals is gone.
return

self._updateStackLevels()
if has_values_changed:
try:
try:
self._updateStackLevels()
if has_values_changed:
self.propertiesChanged.emit()
except RuntimeError:
# QtObject has been destroyed, no need to handle the signals anymore.
# This can happen when the QtObject in C++ has been destroyed, but the python object hasn't quite
# caught on yet. Once we call any signals, it will cause a runtimeError since all the underlying
# logic to emit pyqtSignals is gone.
return
except RuntimeError:
# QtObject has been destroyed, no need to handle the signals anymore.
# This can happen when the QtObject in C++ has been destroyed, but the python object hasn't quite
# caught on yet. Once we call any signals, it will cause a runtimeError since all the underlying
# logic to emit pyqtSignals is gone.
return

def _update(self, container = None):
if not self._stack or not self._watched_properties or not self._key:
Expand Down

0 comments on commit 1cea1cd

Please sign in to comment.