iphone - Leak in MiniZip -
i'm using minizip unzip file in iphone project. works fine leak in instruments in minizip code on line :
unzip.c line 493
s=(unz_s*)alloc(sizeof(unz_s)); *s=us; unzgotofirstfile((unzfile)s); return (unzfile)s;
i understand var allocated alloc returned , not deallocated. in objective-c autorelease, how can achieve in plain c ?
thanks, vincent.
the caller of method responsible s
, must free()
when no longer required avoid memory leak. convention in c.
you have tie in 3rd-party gc library, perhaps hans boehm's gc c/c++. however, suggestion free memory when appropriate on own. you'll run less hassles way.
Comments
Post a Comment