summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-07-15 19:08:05 +0200
committerlouis <louis.braun@gmx.de>2015-07-15 19:08:05 +0200
commit65b61b4e2bfa0c53f7f05c28dc29a5053cc56c27 (patch)
tree57945787812e86e0ae014f81814560a01c36338e
parentac3f69c01edfea239ed7d76c7f8005c0cf4b3a05 (diff)
downloadvdr-plugin-skindesigner-65b61b4e2bfa0c53f7f05c28dc29a5053cc56c27.tar.gz
vdr-plugin-skindesigner-65b61b4e2bfa0c53f7f05c28dc29a5053cc56c27.tar.bz2
fixed crashes if main menu is opened consecutively
-rw-r--r--HISTORY2
-rw-r--r--views/displaymenuitemview.c2
-rw-r--r--views/displaymenulistview.c2
-rw-r--r--views/displaymenulistview.h3
-rw-r--r--views/displaymenurootview.c6
-rw-r--r--views/view.c6
-rw-r--r--views/view.h5
7 files changed, 25 insertions, 1 deletions
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; i<itemCount; i++) {
+ Lock();
if (menuItems[i]) {
delete menuItems[i];
menuItems[i] = NULL;
}
+ Unlock();
}
oneColumn = true;
for (int i=0; i<cSkinDisplayMenu::MaxTabs; i++) {
diff --git a/views/displaymenulistview.h b/views/displaymenulistview.h
index 4e69457..c7aba12 100644
--- a/views/displaymenulistview.h
+++ b/views/displaymenulistview.h
@@ -7,6 +7,7 @@
class cDisplayMenuListView {
private:
+ cMutex mutex;
cTemplateViewList *tmplList;
eMenuCategory cat;
string currentPlug;
@@ -19,6 +20,8 @@ private:
public:
cDisplayMenuListView(cTemplateViewList *tmplList, int count, eMenuCategory cat = mcUnknown, string currentPlug = "");
virtual ~cDisplayMenuListView();
+ void Lock(void) { mutex.Lock(); };
+ void Unlock(void) { mutex.Unlock(); };
void Clear(void);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
int GetMaxItems(void) { return itemCount; };
diff --git a/views/displaymenurootview.c b/views/displaymenurootview.c
index ad735aa..bf3981f 100644
--- a/views/displaymenurootview.c
+++ b/views/displaymenurootview.c
@@ -347,11 +347,15 @@ void cDisplayMenuRootView::KeyInput(bool up, bool page) {
void cDisplayMenuRootView::Clear(void) {
if (view) {
+ view->Lock();
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<eViewElement,cViewElement*>::iterator dVeIt = detachedViewElements.begin(); dVeIt != detachedViewElements.end(); dVeIt++) {
cViewElement *ve = dVeIt->second;
delete ve;
}
+ Unlock();
//clear animations
+ Lock();
for (multimap<int, cAnimation*>::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);