Tuukka Norri avatar Tuukka Norri committed e06c31e

Fixed some memory leaks

Comments (0)

Files changed (4)

Sources/BXDatabaseObjectID.m

 
     NSURL* uri = [[self class] URIRepresentationForEntity: aDesc primaryKeyFields: pkeyFValues];
     BXAssertValueReturn (nil != uri, nil, @"Expected to have received an URI.");
-    return [[[self class] alloc] initWithEntity: aDesc objectURI: uri];
+    return [[[[self class] alloc] initWithEntity: aDesc objectURI: uri] autorelease];
 }
 
 /** 

Sources/PGTSConnection.mm

 {
     if (! mPGTypes)
     {
-        NSString* path = [[[NSBundle bundleForClass: [PGTSConnection class]] resourcePath]
-            stringByAppendingString: @"/datatypeassociations.plist"];
+		NSBundle* bundle = [NSBundle bundleForClass: [PGTSConnection class]];
+        NSString* path = [[bundle resourcePath] stringByAppendingString: @"/datatypeassociations.plist"];
         NSData* plist = [NSData dataWithContentsOfFile: path];
         BXAssertValueReturn (nil != plist, nil, @"datatypeassociations.plist was not found (looked from %@).", path);
         NSString* error = nil;

Sources/PGTSQueryDescription.h

 @interface PGTSConcreteQueryDescription : PGTSQueryDescription
 {
 	SEL mCallback;
-	id mDelegate;
+	id mDelegate; //Weak
 	int mIdentifier;
 	PGTSQuery* mQuery;
 	id mUserInfo;

Sources/PGTSQueryDescription.m

 	return self;
 }
 
+- (void) dealloc
+{
+	[mQuery release];
+	[mUserInfo release];
+	[super dealloc];
+}
+
 - (SEL) callback
 {
 	return mCallback;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.