From 2bd5b9f6b660b326a85cda1727019bf12e7cad8d Mon Sep 17 00:00:00 2001 From: Alexander Malmberg Date: Sat, 29 Mar 2003 20:12:07 +0000 Subject: [PATCH] (mouseDown:) Wrap each iteration of the mouse tracking loop in an autorelease pool. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16289 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSTableView.m | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ecf6f93da..71a60bf2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-03-28 21:08 Alexander Malmberg + + * Source/NSTableView.m (mouseDown:): Wrap each iteration of the mouse + tracking loop in an autorelease pool to avoid using huge amounts of + memory if the button is held down a long time. + 2003-03-28 Serg Stoyan * Source/NSMenuView.m: diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 58da555c9..c9a415a62 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -4278,6 +4278,12 @@ byExtendingSelection: (BOOL)flag lastEvent = theEvent; while (done != YES) { + /* + Wrap each iteration in an autorelease pool. Otherwise, we end + up allocating huge amounts of objects if the button is held + down for a long time. + */ + CREATE_AUTORELEASE_POOL(arp); BOOL shouldComputeNewSelection = NO; switch ([lastEvent type]) { @@ -4470,8 +4476,9 @@ byExtendingSelection: (BOOL)flag inMode: NSEventTrackingRunLoopMode dequeue: YES]; } + DESTROY(arp); } - + if (startedPeriodicEvents == YES) [NSEvent stopPeriodicEvents];