Bug fix for mismatched allocation/deallocation calls. Memory allocated with malloc should use free (not delete) to deallocate memory.
This commit is contained in:
parent
0c36a3575e
commit
0e9ad2f400
|
@ -90,7 +90,7 @@ public:
|
|||
ptr = ::realloc(ptr,len);
|
||||
return ptr;
|
||||
}
|
||||
void free(void *ptr) {
|
||||
static void free(void *ptr) {
|
||||
::free(ptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
Buffer(int size) { length = 0; this->size = size; data = OAKRA_Module::malloc(size); }
|
||||
int getRemaining() { return size-length; }
|
||||
void *data;
|
||||
~Buffer() { delete data; }
|
||||
~Buffer() { if (data){ OAKRA_Module::free(data); data = nullptr; } }
|
||||
};
|
||||
|
||||
std::vector<Buffer*> liveBuffers;
|
||||
|
|
Loading…
Reference in New Issue