diff --git a/HISTORY b/HISTORY index ec5703a..4d24d57 100644 --- a/HISTORY +++ b/HISTORY @@ -392,4 +392,6 @@ Version 0.6.1 - changed skinrepository from static file to github repository - fixed flickering when main menu is fading - some changes in metrixHD +- changed font in metrixhd from "VDROpen Sans" to "Open Sans" +- fixed crashes if main menu is opened consecutively diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index 3e51d46..4f90f3a 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -73,6 +73,8 @@ void cDisplayMenuItemView::EndScrolling(void) { void cDisplayMenuItemView::Action(void) { if (scrolling) { DoSleep(scrollDelay); + if (!Running()) + return; PrepareScrolling(); if (scrollOrientation == orHorizontal) { ScrollHorizontal(scrollingPix, scrollDelay, scrollSpeed, scrollMode); diff --git a/views/displaymenulistview.c b/views/displaymenulistview.c index f40b129..1c4fa2b 100644 --- a/views/displaymenulistview.c +++ b/views/displaymenulistview.c @@ -84,10 +84,12 @@ int cDisplayMenuListView::GetListWidth(void) { void cDisplayMenuListView::Clear(void) { for (int i=0; iLock(); view->ClearChannel(); view->ClearEpgSearchFavorite(); + view->Unlock(); } if (listView) { + listView->Lock(); listView->Clear(); + listView->Unlock(); } if (detailView) { delete detailView; @@ -422,6 +426,7 @@ cFont *cDisplayMenuRootView::GetTextAreaFont(void) { void cDisplayMenuRootView::Render(void) { if (!view) return; + view->Lock(); view->DrawDebugGrid(); if (!view->DrawBackground()) { defaultBackgroundDrawn = true; @@ -453,6 +458,7 @@ void cDisplayMenuRootView::Render(void) { view->DrawStaticViewElements(); view->DrawDynamicViewElements(); + view->Unlock(); } void cDisplayMenuRootView::RenderMenuItems(void) { diff --git a/views/view.c b/views/view.c index 636cefb..de28cfc 100644 --- a/views/view.c +++ b/views/view.c @@ -44,16 +44,20 @@ cView::~cView() { cDevice::PrimaryDevice()->ScaleVideo(cRect::Null); } //clear detached views + Lock(); for (map::iterator dVeIt = detachedViewElements.begin(); dVeIt != detachedViewElements.end(); dVeIt++) { cViewElement *ve = dVeIt->second; delete ve; } + Unlock(); //clear animations + Lock(); for (multimap::iterator animIt = animations.begin(); animIt != animations.end(); animIt++) { cAnimation *anim = animIt->second; anim->Stop(); delete anim; } + Unlock(); //shift or fade out if (fadeOut) { if (IsAnimated()) @@ -94,6 +98,8 @@ void cView::Action(void) { DoFlush(); if (scrolling) { DoSleep(scrollDelay); + if (!Running()) + return; if (scrollOrientation == orHorizontal) { ActivateScrolling(); ScrollHorizontal(scrollingPix, scrollDelay, scrollSpeed, scrollMode); diff --git a/views/view.h b/views/view.h index 8211028..d530f83 100644 --- a/views/view.h +++ b/views/view.h @@ -14,6 +14,7 @@ class cViewElement; class cView : public cPixmapContainer { private: + cMutex mutex; void Init(void); void DoDrawDebugGrid(void); void DoFill(int num, cTemplateFunction *func); @@ -76,8 +77,10 @@ public: cView(cTemplateView *tmplView); cView(cTemplateViewElement *tmplViewElement); cView(cTemplateViewTab *tmplTab); - void DrawDebugGrid(void); virtual ~cView(); + void Lock(void) { mutex.Lock(); }; + void Unlock(void) { mutex.Unlock(); }; + void DrawDebugGrid(void); virtual void Stop(void); void HideAnimations(void); void ShowAnimations(void);