Open ghost opened 10 years ago
I've been compiling with -fsanitize=address
on Linux for a while and this includes a leak checker phase. I am currently getting 37 bytes leaked from an allocation in SDL but the stack trace is incomplete so I can't see where or if the root cause is our code. I know 37 bytes is not "absolutely zero memory leaks" but we might give ourselves a pass on this one?
Some locations we may need to look into are the C memory calls to malloc()
, calloc()
, memcpy()
, memmove()
, and memset()
for a few things:
std::string
or std::vector
which will cause issues when the destructor gets called twice.malloc()/calloc()
memory eventually gets free
d (better yet: convert to smart pointers or vectors).strcpy()
, strncpy()
, strcat()
, and strlen()
are not being used on std::string
types.
KQ v1.0 won't be released until there's absolutely zero memory leaks from KQ itself. Some libraries like Allegro and Lua may leak, but since theses aren't linked to KQ's source code, they won't be taken into account.