fixed blinking deadlock again#

This commit is contained in:
louis 2016-03-05 10:20:45 +01:00
parent cdc1c10204
commit 21ef5263ef
7 changed files with 13 additions and 11 deletions

View File

@ -340,10 +340,10 @@ void cAnimation::Blink(void) {
bool blinkOn = false;
while (Running()) {
Sleep(freq);
if (Running()) {
if (Running())
blinkable->DoBlink(blinkFunc, blinkOn);
if (Running())
blinkable->Flush();
}
blinkOn = !blinkOn;
}
}

View File

@ -42,8 +42,8 @@ public:
bool ActiveTab(void) { return activeTab; };
virtual int GetWidth(void) { return 0; };
virtual void Cache(void) {};
virtual void StopBlinkers(void) {};
virtual void Close(void) {};
virtual void StopBlinkers(void) {};
virtual void Clear(void) {};
virtual void Hide(void) {};
virtual void Show(void) {};

View File

@ -64,8 +64,6 @@ void cSdOsd::DestroyPixmap(cPixmap *pix) {
}
void cSdOsd::Flush(void) {
Lock();
if (osd && !flushLocked)
osd->Flush();
Unlock();
}

View File

@ -215,11 +215,6 @@ void cView::Render(int ve, bool force) {
}
void cView::Close(void) {
for (int i=0; i < numViewElements; i++) {
if (!viewElements[i])
continue;
viewElements[i]->StopBlinking();
}
delete fader;
fader = NULL;
delete shifter;

View File

@ -268,6 +268,7 @@ bool cViewElement::Execute(void) {
void cViewElement::Clear(void) {
tokenContainer->Clear();
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->StopBlinkers();
sdOsd->Lock();
node->Clear();
sdOsd->Unlock();
@ -306,6 +307,7 @@ void cViewElement::Close(void) {
delete detacher;
detacher = NULL;
for (cAreaNode *node = areaNodes.First(); node; node = areaNodes.Next(node)) {
node->StopBlinkers();
sdOsd->Lock();
node->Close();
sdOsd->Unlock();

View File

@ -136,6 +136,7 @@ void cViewGrid::ClearGrids(void) {
for (int i = 0; i < gridsize; i++) {
if (!grid[i])
continue;
grid[i]->StopBlinking();
grid[i]->Close();
delete grid[i];
grid[i] = NULL;

View File

@ -190,7 +190,10 @@ void cViewList::Clear(void) {
if (!listElements)
return;
for (int i = 0; i < numElements; i++) {
listElements[i]->StopBlinking();
listElements[i]->StopScrolling();
}
for (int i = 0; i < numElements; i++) {
listElements[i]->Clear();
}
}
@ -199,7 +202,10 @@ void cViewList::Close(void) {
if (!listElements)
return;
for (int i = 0; i < numElements; i++) {
listElements[i]->StopBlinking();
listElements[i]->StopScrolling();
}
for (int i = 0; i < numElements; i++) {
listElements[i]->Close();
}
}