summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-06-20 06:30:26 +0200
committerlouis <louis.braun@gmx.de>2015-06-20 06:30:26 +0200
commitbc075507080607a79c688c5aef4e1c3d895747ac (patch)
tree8a3df80b1b700ecfa6d4e755534e6dee96c82779
parenta0a6e21d5a7e2ff3097bd851623cf1eef3daf431 (diff)
downloadvdr-plugin-skindesigner-bc075507080607a79c688c5aef4e1c3d895747ac.tar.gz
vdr-plugin-skindesigner-bc075507080607a79c688c5aef4e1c3d895747ac.tar.bz2
fixed crash using animated images in plugins
-rw-r--r--HISTORY2
-rw-r--r--libskindesignerapi/osdelements.c3
-rw-r--r--views/displaypluginview.c2
-rw-r--r--views/view.c14
-rw-r--r--views/view.h2
-rw-r--r--views/viewgrid.c2
6 files changed, 25 insertions, 0 deletions
diff --git a/HISTORY b/HISTORY
index 1153b01..60ace8b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -375,3 +375,5 @@ Version 0.5.3
- added SVG Template parsing
- fixed memory leak when creating fonts
+- fixed crash using animated images in plugins
+
diff --git a/libskindesignerapi/osdelements.c b/libskindesignerapi/osdelements.c
index 74524d7..105a409 100644
--- a/libskindesignerapi/osdelements.c
+++ b/libskindesignerapi/osdelements.c
@@ -78,6 +78,9 @@ skindesignerapi::cViewGrid::cViewGrid(skindesignerapi::ISkinDisplayPlugin *view,
}
skindesignerapi::cViewGrid::~cViewGrid() {
+ if (!view)
+ return;
+ view->ClearGrids(viewGridID);
}
void skindesignerapi::cViewGrid::SetGrid(long gridID, double x, double y, double width, double height) {
diff --git a/views/displaypluginview.c b/views/displaypluginview.c
index 95d9dc0..ba95d93 100644
--- a/views/displaypluginview.c
+++ b/views/displaypluginview.c
@@ -39,6 +39,7 @@ void cDisplayPluginView::Deactivate(bool hide) {
cDevice::PrimaryDevice()->ScaleVideo(cRect::Null);
}
HidePixmaps();
+ HideAnimations();
for (map< int, cViewGrid* >::iterator it = viewGrids.begin(); it != viewGrids.end(); it++) {
cViewGrid *viewGrid = it->second;
viewGrid->Hide();
@@ -52,6 +53,7 @@ void cDisplayPluginView::Activate(void) {
}
if (hidden) {
ShowPixmaps();
+ ShowAnimations();
for (map< int, cViewGrid* >::iterator it = viewGrids.begin(); it != viewGrids.end(); it++) {
cViewGrid *viewGrid = it->second;
viewGrid->Show();
diff --git a/views/view.c b/views/view.c
index 31254bf..98fe38e 100644
--- a/views/view.c
+++ b/views/view.c
@@ -269,6 +269,20 @@ void cView::ClearAnimations(int cat) {
animations.erase(cat);
}
+void cView::HideAnimations(void) {
+ for (multimap<int,cAnimation*>::iterator it = animations.begin(); it!=animations.end(); ++it) {
+ cAnimation *anim = it->second;
+ anim->HidePixmaps();
+ }
+}
+
+void cView::ShowAnimations(void) {
+ for (multimap<int,cAnimation*>::iterator it = animations.begin(); it!=animations.end(); ++it) {
+ cAnimation *anim = it->second;
+ anim->ShowPixmaps();
+ }
+}
+
void cView::ActivateScrolling(void) {
if (veScroll == veUndefined)
return;
diff --git a/views/view.h b/views/view.h
index 1dcaef9..ccdc14c 100644
--- a/views/view.h
+++ b/views/view.h
@@ -78,6 +78,8 @@ public:
void DrawDebugGrid(void);
virtual ~cView();
virtual void Stop(void);
+ void HideAnimations(void);
+ void ShowAnimations(void);
};
class cViewElement : public cView {
diff --git a/views/viewgrid.c b/views/viewgrid.c
index 008133e..551fb9e 100644
--- a/views/viewgrid.c
+++ b/views/viewgrid.c
@@ -71,6 +71,7 @@ void cViewGrid::Hide(void) {
for (map < long, cGrid* >::iterator it = grids.begin(); it != grids.end(); it++) {
cGrid *grid = it->second;
grid->HidePixmaps();
+ grid->HideAnimations();
}
}
@@ -78,6 +79,7 @@ void cViewGrid::Show(void) {
for (map < long, cGrid* >::iterator it = grids.begin(); it != grids.end(); it++) {
cGrid *grid = it->second;
grid->ShowPixmaps();
+ grid->ShowAnimations();
}
}