I have a leakege here but couldnt find the problem;
@property (nonatomic,retain) NSMutableData *responseXMLData;
@property (nonatomic,copy) NSMutableData *lastLo
Without seeing your dealloc
method, we cannot be sure you are correctly releasing the values of these properties.
But in the posted code, I do see one major problem. But it's not where you think.
self.lastLoadedResponseXMLData = docTempData;
This line, although flagged by XCode, is fine (assuming you release the value correctly in dealloc
).
self.responseXMLData = [self.lastLoadedResponseXMLData copy];
This line, however, is not fine. It makes a copy of whatever value is in self.lastLoadedResponseXMLData
but you never release the reference due to the copy. self.responseXMLData
, since it is declared "retain", adds its own reference to the object, and (assuming you release the value correctly in dealloc
) this reference is the one cleaned up.
If you don't really need to care whether the object is the same or is a copy, just forgo the copy. Otherwise, autorelease it:
self.responseXMLData = [[self.lastLoadedResponseXMLData copy] autorelease];