SG-17742 Attempt to fix the crash issue with Houdini#83
Draft
carlos-villavicencio-adsk wants to merge 3 commits into
Draft
SG-17742 Attempt to fix the crash issue with Houdini#83carlos-villavicencio-adsk wants to merge 3 commits into
carlos-villavicencio-adsk wants to merge 3 commits into
Conversation
julien-lang
reviewed
Jan 16, 2024
julien-lang
approved these changes
Jan 17, 2024
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a Houdini crash on exit by replacing Qt’s deleteLater() with a destroy() method to properly clean up objects and by adding debugging utilities to monitor the lifecycle of Qt objects.
- Replace deleteLater() with destroy() on widgets to address memory management issues.
- Introduce utility functions to track QObject lifetimes with debug logging.
- Adjust task manager initialization and widget destruction ordering to ensure proper cleanup.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/app/widget_all_fields.py | Replace deleteLater() with destroy() for widget cleanup. |
| python/app/utils.py | Add functions for monitoring QObject lifetimes to aid in debugging. |
| python/app/dialog.py | Reorder background task manager startup and widget destruction; integrate QObject monitoring. |
Comments suppressed due to low confidence (2)
python/app/utils.py:222
- Consider potential thread-safety issues when modifying the global _g_monitored_qobjects dictionary, especially if accessed from multiple threads.
_g_monitored_qobjects = {}
python/app/dialog.py:282
- Ensure that calling destroy() on UI components in closeEvent aligns with Qt's widget cleanup mechanism and does not lead to premature destruction.
self._overlay.destroy()
| entity_data["model"] = ModelClass( | ||
| entity_data["entity_type"], entity_data["view"], self._task_manager | ||
| ) | ||
| monitor_qobject_lifetime(entity_data["model"]) |
There was a problem hiding this comment.
[nitpick] Consider providing a descriptive name for the monitored model to improve clarity in debug logs.
Suggested change
| monitor_qobject_lifetime(entity_data["model"]) | |
| monitor_qobject_lifetime(entity_data["model"], name=str(ModelClass.__name__)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When opening the tk-multi-shotgunpanel in Houdini, the Houdini app crashes on exit. This has been reported by the community.
This PR attempts to fix this by properly destroying Qt objects on close. This solution was inspired on tk-multi-workfiles2.
destroymethod from tk-framework-shotgunutils instead of QtdeleteLaterwhich causes issues with the garbage collector.This PR requires shotgunsoftware/tk-framework-shotgunutils#149