diff options
author | culler <culler> | 2018-11-16 14:40:51 (GMT) |
---|---|---|
committer | culler <culler> | 2018-11-16 14:40:51 (GMT) |
commit | c37774eec0a06f4966f97ae6605ee85ff7bb635d (patch) | |
tree | 0cb9e374222cee0491c9165c32cb38a9aa1e390d | |
parent | 9c5b4a5840edd04ed8413a973824cbf2636f1f9e (diff) | |
download | tk-c37774eec0a06f4966f97ae6605ee85ff7bb635d.zip tk-c37774eec0a06f4966f97ae6605ee85ff7bb635d.tar.gz tk-c37774eec0a06f4966f97ae6605ee85ff7bb635d.tar.bz2 |
Fix a humongous memory leak on macOS, caused by accidentally deleting a call to [NSApp _unlockAutoreleasePool].
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index dd916d1..7136568 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -912,13 +912,19 @@ ConfigureRestrictProc( TkMacOSXUpdateClipRgn(winPtr); /* - * Finally, generate and process expose events to redraw the window. + * Generate and process expose events to redraw the window. */ HIRect bounds = NSRectToCGRect([self bounds]); HIShapeRef shape = HIShapeCreateWithRect(&bounds); [self generateExposeEvents: shape]; [w displayIfNeeded]; + + /* + * Finally, unlock the main autoreleasePool. + */ + + [NSApp _unlockAutoreleasePool]; } } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index a56444d..9e45996 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -468,7 +468,8 @@ NSStatusItem *exitFullScreen; title = "unnamed window"; } if (DEBUG_ZOMBIES > 1){ - printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + fprintf(stderr, "Autoreleased <%s>. Count is %lu\n", + title, [self retainCount]); } return result; } @@ -479,7 +480,8 @@ NSStatusItem *exitFullScreen; title = "unnamed window"; } if (DEBUG_ZOMBIES > 1){ - printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + fprintf(stderr, "Releasing <%s>. Count is %lu\n", + title, [self retainCount]); } [super release]; } @@ -490,7 +492,8 @@ NSStatusItem *exitFullScreen; title = "unnamed window"; } if (DEBUG_ZOMBIES > 0){ - printf(">>>> Freeing <%s>. Count is %lu\n", title, [self retainCount]); + fprintf(stderr, ">>>> Freeing <%s>. Count is %lu\n", + title, [self retainCount]); } [super dealloc]; } |