Skip to content

Commit 532eda4

Browse files
committed
Merge pull request matplotlib#4144 from mdehoon/fixForIssue4142
Fix for issue 4142: Let show() exit the run loop after all windows are closed in a non-interactive session closes matplotlib#4142
2 parents c412e2e + a36be44 commit 532eda4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/_macosx.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5241,6 +5241,16 @@ - (BOOL)closeButtonPressed
52415241
return YES;
52425242
}
52435243

5244+
- (void)close
5245+
{
5246+
[super close];
5247+
NSArray *windowsArray = [NSApp windows];
5248+
if([windowsArray count]==0) [NSApp stop: self];
5249+
/* This is needed for show(), which should exit from [NSApp run]
5250+
* after all windows are closed.
5251+
*/
5252+
}
5253+
52445254
- (void)dealloc
52455255
{
52465256
PyGILState_STATE gstate;

0 commit comments

Comments
 (0)