From 9e4e5d7e945653edc542d41b8e3d09a0fba0f5f8 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 15 Dec 2013 15:43:10 +0100 Subject: [PATCH] CChannelList::~CChannelList(): fix possible segfault Signed-off-by: Jacek Jendrzej Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e2d12e5d54911fd074f38d8a7b7683291e0c4b6 Author: Jacek Jendrzej Date: 2013-12-15 (Sun, 15 Dec 2013) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 052c6fbb9..a683816eb 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -126,20 +126,26 @@ CChannelList::~CChannelList() { //printf("************ DELETE LIST %s : %x\n", name.c_str(), this);fflush(stdout); chanlist.clear(); - delete dline; - if (cc_minitv) + if(dline){ + delete dline; + dline = NULL; + } + if (cc_minitv){ delete cc_minitv; + cc_minitv = NULL; + } if (headerClock) { headerClock->Stop(); if (headerClock->isPainted()) headerClock->hide(); if (headerClock->isClockRun()) headerClock->stopThread(); - delete headerClock; - headerClock = NULL; + if(headerClock){ + delete headerClock; + headerClock = NULL; + } } } - void CChannelList::ClearList(void) { //printf("************ CLEAR LIST %s : %x\n", name.c_str(), this);fflush(stdout);