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

BUG: Update slicer.util.reloadScriptedModule to remove layout item after cleanup #1156

Closed

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented Jun 19, 2019

No description provided.

@jcfr
Copy link
Member Author

jcfr commented Jun 19, 2019

cc: @lassoan @pieper

# call cleanup function for the existing widget
if hasattr(slicer.modules, widgetName):
w = getattr(slicer.modules, widgetName)
w.cleanup()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is cleanup called again when module is about to be unloaded?
Should we call something like this to avoid double cleanup?

slicer.app.moduleManager().disconnect('moduleAboutToBeUnloaded(QString)', w._onModuleAboutToBeUnloaded)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, the signal should indeed be disconnected.

jcfr and others added 3 commits June 19, 2019 16:47
…ter cleanup

Removing the layout item after calling the cleanup function give the
widget an opportunity to reference existing layout during its own cleanup.
@jcfr jcfr force-pushed the improve-slicer-util-reloadScriptedModule branch from c83f391 to 1980763 Compare June 19, 2019 21:11
@jcfr
Copy link
Member Author

jcfr commented Jun 19, 2019

Closing. Change integrated in r28315 to r28317

@jcfr jcfr closed this Jun 19, 2019
@jcfr jcfr deleted the improve-slicer-util-reloadScriptedModule branch June 19, 2019 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants