From 77cd7c8ef05ccdf7d1f30055d826e6a58c64a7d3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 May 2017 21:14:10 +0200 Subject: [PATCH 1/2] CComponentsTimer: exec OnTimer cleanup after stopped thread Users reported about crashes, but I could not verify them by myself. Supplement to: 8f7b23ad19ebaa6c4f23442a75ca64e7ca63848c Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e9e4de63842bf6c6695bb4117793fc4b4c5067d Author: Thilo Graf Date: 2017-05-29 (Mon, 29 May 2017) --- src/gui/components/cc_timer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index d6659aa38..5f32adf2d 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -143,10 +143,12 @@ bool CComponentsTimer::startTimer() bool CComponentsTimer::stopTimer() { tm_enable = false; - OnTimer.clear(); stopThread(); - if(tm_thread == 0) + if(tm_thread == 0){ + if (!OnTimer.empty()) + OnTimer.clear(); return true; + } return false; } From b8b3a43432fcb841fb1fa66626311fed9f051ecd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 29 May 2017 21:36:12 +0200 Subject: [PATCH 2/2] CProgressBarCache: declare funtions pbcPaint(), pbcPaintBoxRel() as const Technically these members can be const. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/88e0479429e3931f786a6859fb3073e7f7925634 Author: Thilo Graf Date: 2017-05-29 (Mon, 29 May 2017) --- src/gui/components/cc_item_progressbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index c4126f6dc..1613f4eb4 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -145,7 +145,7 @@ class CProgressBarCache static inline unsigned int make16color(__u32 rgb){return 0xFF000000 | rgb;}; - void pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col); + void pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) const; void pbcApplyGradient(fb_pixel_t *pixbuf); void pbcCreateBitmaps(); @@ -177,7 +177,7 @@ class CProgressBarCache } void pbcClear(); public: - void pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width); + void pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) const; static CProgressBarCache *pbcLookup( int dy, int dx, int active_col, @@ -222,7 +222,7 @@ CProgressBarCache *CProgressBarCache::pbcLookup(int dy, int dx, int active_col, return pbc; } -void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) +void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_passive_width) const { y += yoff; static CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); @@ -249,7 +249,7 @@ void CProgressBarCache::pbcPaint(int x, int y, int pbc_active_width, int pbc_pas } } -void CProgressBarCache::pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) +void CProgressBarCache::pbcPaintBoxRel(int x, int y, int dx, int dy, fb_pixel_t *pixbuf, fb_pixel_t col) const { if (x < 0) { dx -= x;