From 8eeae278b54410f03410105c5621bd690523f61c Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 30 Sep 2013 06:00:55 +0200 Subject: fixed a bug if DisplayMenu is called before image cache is completely initialised --- imagecache.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'imagecache.c') 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) { -- cgit v1.2.3