summaryrefslogtreecommitdiff
path: root/imagecache.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-09-30 06:00:55 +0200
committerlouis <louis.braun@gmx.de>2013-09-30 06:00:55 +0200
commit8eeae278b54410f03410105c5621bd690523f61c (patch)
treef4d8638ce95e3e2a48f592740d7feb873cffebfb /imagecache.c
parent301b8ff21bccd136e48f2a63f943d69a9ef9c67f (diff)
downloadskin-nopacity-8eeae278b54410f03410105c5621bd690523f61c.tar.gz
skin-nopacity-8eeae278b54410f03410105c5621bd690523f61c.tar.bz2
fixed a bug if DisplayMenu is called before image cache is completely initialised
Diffstat (limited to 'imagecache.c')
-rw-r--r--imagecache.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/imagecache.c b/imagecache.c
index 452a942..4dc6507 100644
--- a/imagecache.c
+++ b/imagecache.c
@@ -6,6 +6,7 @@
using namespace Magick;
cImageCache::cImageCache() : cImageMagickWrapper() {
+ initComplete = false;
osdTheme = Setup.OSDTheme;
}
@@ -83,6 +84,8 @@ cImage *cImageCache::GetSkinIcon(std::string name, int width, int height, bool p
}
cImage *cImageCache::GetBackground(eBackgroundType type) {
+ if (!initComplete)
+ return NULL;
try {
return backgroundImages[(int)type];
} catch (...) {
@@ -289,6 +292,8 @@ void cImageCache::CreateBackgroundImages(void) {
bool mirrorHeader = (config.menuAdjustLeft) ? false : true;
CreateBackground(Theme.Color(clrMenuHeaderBlend), Theme.Color(clrMenuHeader), geoManager->osdWidth, geoManager->menuHeaderHeight, mirrorHeader);
backgroundImages.push_back(CreateImage());
+
+ initComplete = true;
}
void cImageCache::Clear(void) {