all repos — mgba @ 2e330b92a73e67aa6b238bb4a07840e235557082

mGBA Game Boy Advance Emulator

Feature: Fix memory leak in mVideoLogContext
Vicki Pfau vi@endrift.com
Wed, 04 Jul 2018 12:46:49 -0700
commit

2e330b92a73e67aa6b238bb4a07840e235557082

parent

4767ae42d292514186b85694beac061037822394

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M src/feature/video-logger.csrc/feature/video-logger.c

@@ -682,6 +682,18 @@ }

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); }