6

I just cloned the git repository for the SBJson framework and imported the source code into my application. Ran a Static Memory profiler and got a little scared from the results I saw. See the picture

enter image description here

How is this possible? I doubt the developer of this very well known library didn't see this? And indeed, if a run a memory profile it shows memory leaks from this library.

Any ideas? Thx

Eugen
  • 2,934
  • 2
  • 26
  • 47
  • warrenm answered it correctly below, but I'd just like to point out that version 3.2 of SBJson makes it a compile error to attempt to compile without ARC support. – Stig Brautaset Jan 21 '13 at 23:35

1 Answers1

8

It looks like you're using SBJSON in a project that doesn't have ARC enabled. Since ARC removes the need to call release explicitly, code written for ARC (like SBJSON) causes memory leaks when used in a non-ARC project. You should convert your project to use ARC with the built-in refactoring tool (Edit > Refactor > Convert to Objective-C ARC, then explicitly set the -fno-objc-arc compiler flag on any of your source that is not yet ARC-ready.

warrenm
  • 31,094
  • 6
  • 92
  • 116
  • 6
    Alternatively you can downgrade to SBJson v3.0.4 which is non-ARC. – Vadim Yelagin Mar 25 '12 at 07:27
  • 1
    You could, but there is no disadvantage to converting a project to ARC. The chief advantage is that you're able to take advantage of fixes introduced in more recent versions of your dependencies instead of staying frozen in time. – warrenm Mar 25 '12 at 17:20