From 7a2a7633d5d0f2c8b42a66d1bb5ccfb461d3e7b2 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 8 May 2015 17:11:40 +0200 Subject: [PATCH] Fix videoplayer destruction issue that valgrind complained about --- extern/osg-ffmpeg-videoplayer/videostate.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extern/osg-ffmpeg-videoplayer/videostate.cpp b/extern/osg-ffmpeg-videoplayer/videostate.cpp index 4dd6188587..dea08de92c 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.cpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.cpp @@ -721,7 +721,12 @@ void VideoState::deinit() avformat_close_input(&this->format_ctx); } - mTexture = NULL; + if (mTexture) + { + // reset Image separately, it's pointing to *this and there might still be outside references to mTexture + mTexture->setImage(NULL); + mTexture = NULL; + } } double VideoState::get_external_clock()