Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Chore tools: Make sure style object is not garbage collected#6136

Merged
iLLiCiTiT merged 1 commit intodevelopfrom
bugfix/style-polish-fix
Jan 16, 2024
Merged

Chore tools: Make sure style object is not garbage collected#6136
iLLiCiTiT merged 1 commit intodevelopfrom
bugfix/style-polish-fix

Conversation

@iLLiCiTiT
Copy link
Copy Markdown
Member

Changelog Description

Minor fix in tool utils to make sure style C++ object is not garbage collected when not stored into variable.

Traceback from houdini

Traceback (most recent call last):
  File "some_test", line 1, in <module>
  File "C:\OpenPype\openpype\hosts\houdini\api\lib.py", line 1056, in self_publish
    publisher_show_and_publish(comment)
  File "C:\OpenPype\openpype\hosts\houdini\api\lib.py", line 976, in publisher_show_and_publish
    publisher_window = get_tool_by_name(
  File "C:\OpenPype\openpype\tools\utils\host_tools.py", line 416, in get_tool_by_name
    return _SingletonPoint.get_tool_by_name(tool_name, parent, *args, **kwargs)
  File "C:\OpenPype\openpype\tools\utils\host_tools.py", line 411, in get_tool_by_name
    return cls.helper.get_tool_by_name(tool_name, parent, *args, **kwargs)
  File "C:\OpenPype\openpype\tools\utils\host_tools.py", line 341, in get_tool_by_name
    return self.get_publisher_tool(parent, *args, **kwargs)
  File "C:\OpenPype\openpype\tools\utils\host_tools.py", line 298, in get_publisher_tool
    publisher_window = PublisherWindow(
  File "C:\OpenPype\openpype\tools\publisher\window.py", line 107, in __init__
    create_tab = tabs_widget.add_tab("Create", "create")
  File "C:\OpenPype\openpype\tools\publisher\widgets\tabs_widget.py", line 71, in add_tab
    self.set_current_tab(identifier)
  File "C:\OpenPype\openpype\tools\publisher\widgets\tabs_widget.py", line 100, in set_current_tab
    new_btn.activate()
  File "C:\OpenPype\openpype\tools\publisher\widgets\tabs_widget.py", line 26, in activate
    set_style_property(self, "active", "1")
  File "C:\OpenPype\openpype\tools\utils\lib.py", line 94, in set_style_property
    widget.style().polish(widget)
RuntimeError: Internal C++ object (PySide2.QtWidgets.QProxyStyle) already deleted.

Testing notes:

  1. Publisher should work as expected in Houdini

@ynbot ynbot added type: bug Something isn't working size/XS Denotes a PR changes 0-99 lines, ignoring general files labels Jan 16, 2024
Copy link
Copy Markdown
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These errors with Qt look familiar - this is the usual fix. Looks good to me.

@iLLiCiTiT iLLiCiTiT merged commit 97030a9 into develop Jan 16, 2024
@iLLiCiTiT iLLiCiTiT deleted the bugfix/style-polish-fix branch January 16, 2024 10:02
@ynbot ynbot added this to the next-patch milestone Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/XS Denotes a PR changes 0-99 lines, ignoring general files type: bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants