From 6e8c1cac9643fa044fb4d8ab358a0c290394d171 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 23 May 2017 17:48:15 +0200 Subject: [PATCH 1/7] src/gui/adzap.cpp init before use --- src/gui/adzap.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp index 0199bc779..bc251f253 100644 --- a/src/gui/adzap.cpp +++ b/src/gui/adzap.cpp @@ -66,15 +66,16 @@ CAdZapMenu::CAdZapMenu() sem_init(&sem, 0, 0); + channelId = -1; + armed = false; + monitor = false; + alerted = false; + pthread_t thr; if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); else pthread_detach(thr); - channelId = -1; - armed = false; - monitor = false; - alerted = false; } static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) From fcc3a12e887707c969aab1b27e730cda43d60168 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 23 May 2017 17:52:16 +0200 Subject: [PATCH 2/7] src/gui/screensaver.cpp try to fix segfault on stop --- src/gui/screensaver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 3bf274b39..d3d61e7bb 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -164,7 +164,7 @@ void* CScreenSaver::ScreenSaverPrg(void* arg) if (g_settings.screensaver_timeout) { - while(1) + while(PScreenSaver) { PScreenSaver->paint(); sleep(g_settings.screensaver_timeout); From 4455c65225949be58d255af6a579c9dddb55f3ca Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 02:51:36 +0200 Subject: [PATCH 3/7] CComponentsFrmClock: fix wrong comparison --- src/gui/components/cc_frm_clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 297406e9f..b43ffbbff 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -390,7 +390,7 @@ void CComponentsFrmClock::paint(bool do_save_bg) void CComponentsFrmClock::setClockFont(Font *font, const int& style) { - if (cl_font != font || (cl_font != font)){ + if (cl_font != font || cl_font_style != style){ if (cl_font != font) cl_font = font; if (style != -1) From 979e6370a76bd4ce03bc6a5518c83adafc739a2d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 02:51:36 +0200 Subject: [PATCH 4/7] CCDraw: expand debug output inside clearFbGradientData() get info for addresses. --- src/gui/components/cc_draw.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index dbca41d93..078edf940 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -374,15 +374,16 @@ bool CCDraw::clearFbGradientData() for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].gradient_data){ if (v_fbdata[i].gradient_data->gradientBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->gradientBuf); free(v_fbdata[i].gradient_data->gradientBuf); v_fbdata[i].gradient_data->gradientBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradientBuf...\033[0m\n", __func__, __LINE__); } if (v_fbdata[i].gradient_data->boxBuf){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data->boxBuf); cs_free_uncached(v_fbdata[i].gradient_data->boxBuf); v_fbdata[i].gradient_data->boxBuf = NULL; - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up boxBuf...\033[0m\n", __func__, __LINE__); } + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], clean up gradient data \t %p...\033[0m\n", __func__, __LINE__, v_fbdata[i].gradient_data); delete v_fbdata[i].gradient_data; v_fbdata[i].gradient_data = NULL; ret = true; From 1f8007c50c5d7c4af1cf8c223d2de679667f058e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 02:51:36 +0200 Subject: [PATCH 5/7] CComponentsHeader: ensure reset of icon object --- src/gui/components/cc_frm_header.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f0a5ba052..bce82f375 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -232,8 +232,10 @@ void CComponentsHeader::initIcon() //init cch_icon_obj only if an icon available if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj) + if (cch_icon_obj){ removeCCItem(cch_icon_obj); + cch_icon_obj = NULL; + } return; } From de3c14a8810f14bd1439401475b4b2c4c487cf57 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 17:23:33 +0200 Subject: [PATCH 6/7] CComponentsFrmClock: init OnTimer after ititialized timer object Content of OnTimer was not considered after init of timer object. --- src/gui/components/cc_frm_clock.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index b43ffbbff..46d4781df 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -325,12 +325,14 @@ bool CComponentsFrmClock::startClock() if (cl_timer == NULL){ cl_timer = new CComponentsTimer(0); cl_timer->setThreadName("frmClock"); - if (cl_timer->OnTimer.empty()){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); - cl_timer->OnTimer.connect(cl_sl_show); - force_paint_bg = true; - } } + + if (cl_timer->OnTimer.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); + cl_timer->OnTimer.connect(cl_sl_show); + force_paint_bg = true; + } + cl_timer->setTimerInterval(cl_interval); if (cl_timer->startTimer()) From c0fe5d24027da1dd4f7a5f250b14b6e0bf915759 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 May 2017 17:24:48 +0200 Subject: [PATCH 7/7] CComponentsTimer: ensure cleanup of OnTimer signal while sopping timer --- src/gui/components/cc_timer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index ab6523840..d6659aa38 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -143,6 +143,7 @@ bool CComponentsTimer::startTimer() bool CComponentsTimer::stopTimer() { tm_enable = false; + OnTimer.clear(); stopThread(); if(tm_thread == 0) return true;