Trying to track down what I'm missing here.
Running on CentOs5.
I have boiled this down to a simple simple program and still end up with a memory leak. Not sure if this is a bug in Valgrind or a bug in libobjc.
main.m
int main(){return 0;}
and I compile and link it with gcc
gcc main.m -o main -lobjc
When I run valgrind main I get leaked memory
==27005== HEAP SUMMARY:
==27005== in use at exit: 8,485 bytes in 133 blocks
==27005== total heap usage: 145 allocs, 12 frees, 11,053 bytes allocated
==27005==
==27005== LEAK SUMMARY:
==27005== definitely lost: 16 bytes in 1 blocks
==27005== indirectly lost: 16 bytes in 1 blocks
==27005== possibly lost: 0 bytes in 0 blocks
==27005== still reachable: 8,453 bytes in 131 blocks
==27005== suppressed: 0 bytes in 0 blocks
If I don't link libobjc (leave off the -lobjc) I get no memory leaks.
Ideas?
Maybe there is not libobjc on your centOS? I build and run your code on Mountain Lion ,there is no warnings or errors.