Skip to content
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

SG-17742 Attempt to fix the crash issue with Houdini #149

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions python/shotgun_model/shotgun_query_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,15 @@ def __do_depth_first_tree_deletion(self, node):

# delete the child leaves
for index in range(node.rowCount(), 0, -1):
# Use `takeRow` instead of `removeRow` to prevent model from deleting
# the data before we're done using it. takeRow does not free the memory
# but we own the objects and do not keep a reference to it, so garbage
# collection will take care of freeing up the memory for us.
node.takeRow(index - 1)
if sgtk.platform.current_engine().instance_name == "tk-houdini":
node.removeRow(index - 1)
else:
# For every other engine,
# Use `takeRow` instead of `removeRow` to prevent model from deleting
# the data before we're done using it. takeRow does not free the memory
# but we own the objects and do not keep a reference to it, so garbage
# collection will take care of freeing up the memory for us.
node.takeRow(index - 1)

def __remove_unique_id_r(self, item):
"""
Expand Down