> Am 20.03.2018 um 07:31 schrieb amon <a...@vnl.com>:

> I did try coding
> p=[NSAutoreleasePool new]; do something; [p release];
> and in some cases it seemed to help. In others it did not.
> I'll be digging deeper tomorrow and I will give the macros
> you suggested a try.

Just one word of warning. If you use this code (or the equivalent 
CREATE_AUTORELEASE_POOL macro), be sure to catch any exception that is raised 
in the "do something" code and make sure that the pool gets released, i.e., use
  p = [NSAutoreleasePool new];
  @try {
    do something;
  }
  @finally {
    [p release];
  }
Otherwise, you'll leak a whole autorelease pool on every exception raised in 
the do something part.

Wolfgang


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to