kshitij godara
kshitij godara

Reputation: 1523

Potential memory leak - Received Memory Warning

I am using iOS 7 and I am getting memory warnings in this part of code, but I'am not able to understand how the retain count increases as I release imageToSave variable too.

This is image of code when i analyze my code

Upvotes: 0

Views: 157

Answers (2)

Rana
Rana

Reputation: 451

You have not allocated memory to this object yourself, so you don't own it. And you are still releasing it.You can't release objects you don't own. Unless you use alloc method to allocate memory, you can't just release them........

Upvotes: 1

Retro
Retro

Reputation: 4005

Static analyser not always write about memory leak but its assuming that when you are calling finalOutput its returning you an allocated object mean +1 retain count object which is never used and its treating this waring as memory leak!

Upvotes: 1

Related Questions