mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed crashes if main menu is opened consecutively
This commit is contained in:
parent
ac3f69c01e
commit
65b61b4e2b
2
HISTORY
2
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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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++) {
|
||||
|
@ -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; };
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user