From e908858c1902ca8d4f523a842b3a3c95ce3f4264 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 17 Feb 2017 12:11:03 +0100 Subject: [PATCH] try to fix segfault with --enable-cleanup --- src/gui/movieplayer.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0fda64768..893508633 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -118,17 +118,24 @@ CMoviePlayerGui::CMoviePlayerGui() CMoviePlayerGui::~CMoviePlayerGui() { - //playback->Close(); if (this == instance_mp) stopPlayBack(); - delete moviebrowser; - moviebrowser = NULL; - delete filebrowser; - filebrowser = NULL; - delete bookmarkmanager; - bookmarkmanager = NULL; - delete playback; - playback = NULL; + if(moviebrowser){ + delete moviebrowser; + moviebrowser = NULL; + } + if(filebrowser){ + delete filebrowser; + filebrowser = NULL; + } + if(bookmarkmanager){ + delete bookmarkmanager; + bookmarkmanager = NULL; + } + if(playback){ + delete playback; + playback = NULL; + } if (this == instance_mp) { delete instance_bg; instance_bg = NULL;