Search code examples
iphonememory-leaksuiimagecalayerinstruments

What could a leaked UIImage of size 16 Bytes indicate?


16 Bytes is pretty small, right? None of the UIImages I create in my app are that small, yet the Leaks Instrument is reporting a leaked UIimage of size 16 Bytes... Any clues on what this could be? Incidentally, there was also a leaked CALayer object of 48 bytes...


Solution

  • UIImages are just a thin wrapper around CGImageRefs; most likely you have an uninitialized UIImage somewhere (or something similar):

    - (void)leakImage
    {
        UIImage *leaked = [UIImage alloc];
    }