URL: <https://savannah.gnu.org/bugs/?59204>
Summary: NSOperationQueue leak Project: GNUstep Submitted by: lcampbel Submitted on: Tue 29 Sep 2020 12:39:15 PM UTC Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: The following code demonstrates that NSOperationQueue leaks operations. It should (and, on Mac OS X, does) print "t retain count is 1" at the end. On gnustep, it prints "t retain count is 2". #import <Foundation/Foundation.h> @interface Test : NSObject @end @implementation Test - (void)frob { NSLog(@"frob"); } - (void)test { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSOperationQueue *opq = [[NSOperationQueue new] autorelease]; NSInvocationOperation *op = [[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(frob) object:nil] autorelease]; [opq addOperation:op]; [opq waitUntilAllOperationsAreFinished]; [pool release]; } @end int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; Test *t = [[Test new] autorelease]; [t test]; NSLog(@"t retain count is %lu", [t retainCount]); [pool release]; return 0; } _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?59204> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/