mirror of https://github.com/mgba-emu/mgba.git
Feature: Fix memory leak in mVideoLogContext
This commit is contained in:
parent
4767ae42d2
commit
2e330b92a7
|
@ -682,6 +682,18 @@ void mVideoLogContextDestroy(struct mCore* core, struct mVideoLogContext* contex
|
|||
if (context->initialState) {
|
||||
mappedMemoryFree(context->initialState, context->initialStateSize);
|
||||
}
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < context->nChannels; ++i) {
|
||||
CircleBufferDeinit(&context->channels[i].buffer);
|
||||
#ifdef USE_ZLIB
|
||||
if (context->channels[i].inflating) {
|
||||
inflateEnd(&context->channels[i].inflateStream);
|
||||
context->channels[i].inflating = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
free(context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue