Commit Graph

3 Commits

Author SHA1 Message Date
Ricardo Quesada be64dd97cf replaces `delete[]` with `free()` in C-based API
API that returns a newly allocated buffer as an output argument (not return value) are error-prone.

- Users forget to release the newly allocated buffer
- Or the call `delete` instead of `delete[]`

But some of those API need to call `realloc` on the buffer.
But `realloc` is only valid if the buffer was previously allocated with `malloc`.
If a buffer needs to be re-allocated using a C++ API, then `std::vector<char*>` should be used instead...

So, this patch does:

- Migrates the API from  `new []` / `delete[]` to  `malloc()` / `free()`
- Fixes all the memory issues: incorrect deallocs and memory leaks
- Updates the documentation
- And fixes misc issues with the API: removes `cc` from the ZipUtils class.
2013-11-11 18:09:47 -08:00
James Chen 2e80e95a37 [Linux] compilation fix for PR #4099 2013-11-06 15:26:33 +08:00
James Chen 352d1f6768 issue #2905: Renaming lua/cocos2dx_support to lua/bindings. 2013-10-16 16:40:07 +08:00