0

My question says everything. is it even possible? this is pretty weird and I am not sure where to look or what to do. Everything is being released in simulator and when I run in app using debug mode. I can see the logs inside my dealloc methods and everything is working fine. but when i run my application in release mode. the objects are not released.

anybody else had this issue?

Lithu T.V
  • 19,955
  • 12
  • 56
  • 101
g.revolution
  • 11,962
  • 23
  • 81
  • 107

2 Answers2

1

From what I understood, ARC auto-releases object with different timing weither you're building in debug or release mode. This is due to the optimization flag of the compiler being -O0 in debug and -O3 or -Os in release.

I recall hearing an Apple engineer talking about it in one of the WWDC '13 talks (I'll try to find the session name), and from what I remember, this behaviour will be improved in the futures Xcode builds to make ARC in debug mode behave much more like it does in release mode.

I know it does not help much, but I'm not familiar enough with ARC implementation to offer more details.

See also How do you debug an issue with a release mode build in iOS? to help debug your code in release mode.

Community
  • 1
  • 1
Guillaume Algis
  • 10,705
  • 6
  • 44
  • 72
  • 3
    But the only cases I have seen so far were the other way around: In Release mode (with optimization) the objects are released earlier than in Debug mode (without optimization). – Martin R Jun 27 '13 at 10:53
0

Could you accidentally have Zombies turned on for release mode but off for debug? Normally all diagnostics are off for release but it would fit your description.

ahwulf
  • 2,584
  • 15
  • 29