-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clearing operation stack when a new project is loaded #18883
base: main
Are you sure you want to change the base?
Conversation
This update refines the cleanup process across different parts of the application. Node reset functionality has been introduced which thoroughly cleans up the memory. Clear functions within SettingOverrideDecorator, SceneNodeDecorator, ConvexHullDecorator and others are improved to completely cleanse after usage. This approach ensures a more efficient use and management of memory resources. CURA-11658
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit afraid that this change can create crashes in Cura. Those variables may be expected to be non-Null when calling some methods on the objects, and the objects are actually still referenced and callable. I would go for only clearing the references that actually hold a lot of memory (mesh data) and don't touch the rest.
The "clear" method has been renamed to "clearDecoratorData" to improve clarity on its function in several classes. This change affects the SettingOverrideDecorator, SceneNodeDecorator, ConvexHullDecorator, and SceneNode classes. CURA-11658
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still afraid of potentional crashes, e.g. when setting self._global_stack
to None
, this object is being called in every method without a check 😬 but I let you be the final judge of this. Or maybe have a second opinion from @nallath ?
@@ -2281,8 +2281,8 @@ def appHeight(self) -> int: | |||
return 0 | |||
|
|||
@pyqtSlot() | |||
def deleteAll(self, only_selectable: bool = True) -> None: | |||
super().deleteAll(only_selectable = only_selectable) | |||
def deleteAll(self, only_selectable: bool = True, clear_all:bool = False) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def deleteAll(self, only_selectable: bool = True, clear_all:bool = False) -> None: | |
def deleteAll(self, only_selectable: bool = True, clear_all:bool = False) -> None: |
We should guard against bool traps here. You can do that by by adding a param that eats up all unnamed arguments.
I'm not quite sure how this would even prevent the memory that much? |
CURA-11658