Permalink
Browse files

Feature: Fix memory leak in mVideoLogContext

  • Loading branch information...
endrift committed Jul 4, 2018
1 parent 4767ae4 commit 2e330b92a73e67aa6b238bb4a07840e235557082
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/feature/video-logger.c
View
@@ -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);
}

0 comments on commit 2e330b9

Please sign in to comment.