objective c - What does "Leak of returned object" mean, from Clang? -


In addition I have set a bunch of memory leaks (basically)

I have all The clear memory leak was fixed, but the reel has found a four "leaked object leak" bug, I'm not sure how to sort:

There are appropriate bits of full message / code:

  NSMutableData * data = [[NSMutableData alloc] init];  

[1] Method returns a return number (proprietary reference) with an Object-C object return

  [...] snprintf (buffer) , 32, "% lu:", [object length]); [Data attachment buffers: buffer length: stron (buffer)]; [DataApendData: Object]; Return data; Calling the object was returned as an owner reference (counting to keep a single to move the collar)    

[3] Div>

OK, so to extend the reply above (thanks for setting me on the right track) ...

  back [data autores]  

You have allocated some objects "data", and returning this object to the caller . The way in which it works in Objective-C is that at some level of the call stack, there is a NSUtteroCollipul when you send data to the "autorelease" message, then it adds itself to that autoreclose pool. This collar allows the "data" object to be summarized (i.e., above the duration of the local stack frame), without the need to explicitly call "release", and finally, when the autoreclass pool " Pop ", the data will be deloquently (unless a call is" kept ") it's not smart.

Sweet. I think I have now earned my green belt in the OBJ-C memory management.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -