diff options
author | Kevin Walzer <kw@codebykevin.com> | 2015-03-21 01:22:30 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2015-03-21 01:22:30 (GMT) |
commit | 6596343ef6a711a8b5a51e17c946f206a90efe16 (patch) | |
tree | aa5390457f8371d6bf3eb56d179db157eaecc722 /macosx/tkMacOSXSubwindows.c | |
parent | 4f6c1ad7943f8c595d9d539a6c6c33c96832554b (diff) | |
download | tk-6596343ef6a711a8b5a51e17c946f206a90efe16.zip tk-6596343ef6a711a8b5a51e17c946f206a90efe16.tar.gz tk-6596343ef6a711a8b5a51e17c946f206a90efe16.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 ee9167b..869f717 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]; } /* |