diff --git a/src/_macosx.m b/src/_macosx.m index dc8d9809fb50..551dac41ec89 100644 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -5241,6 +5241,16 @@ - (BOOL)closeButtonPressed return YES; } +- (void)close +{ + [super close]; + NSArray *windowsArray = [NSApp windows]; + if([windowsArray count]==0) [NSApp stop: self]; + /* This is needed for show(), which should exit from [NSApp run] + * after all windows are closed. + */ +} + - (void)dealloc { PyGILState_STATE gstate;