8000 Check the number of windows remaining after closing one so that we ca… · matplotlib/matplotlib@a36be44 · GitHub
[go: up one dir, main page]

Skip to content

Commit a36be44

Browse files
committed
Check the number of windows remaining after closing one so that we can exit [NSApp run] after all windows have been closed. This is needed for show() to exit the run loop in non-interactive sessions.
1 parent 1fe5b9c commit a36be44

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)
0