Skip to content

Fix for issue 4142: Let show() exit the run loop after all windows are closed in a non-interactive session - #4144

Merged
tacaswell merged 1 commit into
matplotlib:masterfrom
mdehoon:fixForIssue4142
Feb 22, 2015
Merged

tacaswell merged 1 commit into
matplotlib:masterfrom
mdehoon:fixForIssue4142

Conversation

@mdehoon

@mdehoon mdehoon commented Feb 22, 2015

Copy link
Copy Markdown
Contributor

See issue 4142. Currently show() does not exit after all windows have been closed. The relevant code was in src/_macosx.m, but was inadvertently lost in pull request 4006. This bug fix checks the number of windows remaining after closing one window, and calls [NSApp stop: self] if there are no more windows.
One open question is how Python show respond to keyboard interrupts (ctrl-c) while show() is running. Currently ctrl-c does nothing (other than printing ctrl-c to the screen). I guess it would make sense for ctrl-c to cause show() to exit.

…n exit [NSApp run] after all windows have been closed. This is needed for show() to exit the run loop in non-interactive sessions.
@tacaswell tacaswell added this to the next point release milestone Feb 22, 2015
@cimarronm

Copy link
Copy Markdown
Contributor

looks good here

tacaswell added a commit that referenced this pull request Feb 22, 2015
Fix for issue 4142: Let show() exit the run loop after all windows are closed in a non-interactive session

closes #4142
@tacaswell
tacaswell merged commit 532eda4 into matplotlib:master Feb 22, 2015
@mdehoon
mdehoon deleted the fixForIssue4142 branch February 23, 2015 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants