Skip to content

Commit

Permalink
Release v3.0.4 (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
staceyoue authored Mar 13, 2024
2 parents 1f469bd + d9b63c7 commit 794f7ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ def destroy_engine(self):
self.__event_watcher = None

if self.__menu_generator:
if not self.__sio or self.__sio.connected:
self.__menu_generator.clean_menu()
if self.__sio and not self.__sio.connected:
self.logger.error(
"No connection to Alias server. Can't remove ShotGrid menu."
)
else:
self.__menu_generator.remove_menu()
self.__menu_generator = None

# Close all Shotgun app dialogs that are still opened since some apps do threads
Expand Down
7 changes: 5 additions & 2 deletions python/tk_alias/menu_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ def remove_menu(self):

if not self.alias_menu:
return self.engine.alias_py.AlStatusCode.InvalidObject
status = self.alias_menu.remove()
if hasattr(self.alias_menu, "remove"):
status = self.alias_menu.remove()
else:
status = self.clean_menu()
self.__alias_menu = None
return status

def clean_menu(self):
"""Clean the ShotGrid menu in Alias by removing all its entries."""

self.alias_menu.clean()
return self.alias_menu.clean()

def _add_context_menu(self):
"""
Expand Down

0 comments on commit 794f7ed

Please sign in to comment.