zdl411437734 / sqlitepersistentobjects

Automatically exported from code.google.com/p/sqlitepersistentobjects
0 stars 0 forks source link

Leak in SQLitePersistentObject.m resolveClassMethod #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load an object

What is the expected output? What do you see instead?
It loads without leaks. There is a leak.

What version of the product are you using? On what operating system?
r129, Mac OS X 10.5.6, iPhone SDK 2.2.1

Please provide any additional information below.

The string methodbeingcalled never get's released.
You have to add this at the end of the method:

                //Why not release the string?
        [methodBeingCalled release];

        return [super resolveClassMethod:theMethod];

Regards,
Fabian

Original issue reported on code.google.com by fab...@fabian-kreiser.com on 6 Mar 2009 at 8:38

GoogleCodeExporter commented 9 years ago
Leak is on line 1291. The fix is present but commented out.

1291        NSString *methodBeingCalled = [[NSString alloc] 
initWithUTF8String:methodName];
1292        //  NSString *methodBeingCalled = [NSString 
stringWithUTF8String:methodName];

 Switching to the autoreleased version of methodBeingCalled doesn't cause me any errors and fixes the leak.

Original comment by rog.no...@gmail.com on 13 Mar 2009 at 3:21

GoogleCodeExporter commented 9 years ago
Maybe someone wanted to remove all autoreleased stuff and forgot the 
corresponding release call...
Please fix this soon.

Original comment by fab...@fabian-kreiser.com on 13 Mar 2009 at 7:34