diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-03-21 01:22:36 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-03-21 01:22:36 (GMT) |
commit | 50ec1ecb24801b023618048a6704fa12670671d9 (patch) | |
tree | aecf3fb93bddea1561e21b4945307339af8f0d7e /macosx/tkMacOSXSubwindows.c | |
parent | f22c4207e5275f1e2c792672b41f6828372d6203 (diff) | |
download | tk-50ec1ecb24801b023618048a6704fa12670671d9.zip tk-50ec1ecb24801b023618048a6704fa12670671d9.tar.gz tk-50ec1ecb24801b023618048a6704fa12670671d9.tar.bz2 |
Cleanup and simplification of memory management in event loop; now works more smoothly; thanks to Marc Culler for patches
Diffstat (limited to 'macosx/tkMacOSXSubwindows.c')
-rw-r--r-- | macosx/tkMacOSXSubwindows.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 95cc338..a9703c1 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -131,6 +131,11 @@ XMapWindow( { MacDrawable *macWin = (MacDrawable *) window; XEvent event; + /* + * This function can be called from outside the AppKit event + * loop, so it needs its own AutoreleasePool. + */ + NSAutoreleasePool* pool = [NSAutoreleasePool new]; /* * Under certain situations it's possible for this function to be called @@ -189,6 +194,7 @@ XMapWindow( event.xvisibility.type = VisibilityNotify; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(macWin->winPtr, &event); + [pool drain]; } /* |