summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/Theme.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-09-21 18:01:36 +0200
committerMichael Stahl <mstahl@redhat.com>2013-09-21 18:17:27 +0200
commitca0169340c94adc791061e3fb098fa656f22a8c5 (patch)
tree796351fb0e821f7a78d87c3080d103ececb79675 /sfx2/source/sidebar/Theme.cxx
parentf814795ac9e90414a00bdff754f9dd7810382e63 (diff)
sfx2: fix sfx2::sidebar::Theme lifecycle
It's a horrible idea to have global VCL Images, since that will inevitably crash on shutdown when the static dtor runs after DeInitVCL, which breaks ~every JunitTest now. 0x00002af6750d2d51 in rtl::Reference<sfx2::sidebar::Theme>::~Reference (this=0x2af6756ceb28 <sfx2::sidebar::Theme::mpInstance>, __in_chrg=<optimized out>) Try to fix that by moving the global sidebar::Theme instance to SfxApplication where it can hopefully be deleted before shutdown. Change-Id: Ia78f1e458699335b53a741b6463ce48af69584a7
Diffstat (limited to 'sfx2/source/sidebar/Theme.cxx')
-rw-r--r--sfx2/source/sidebar/Theme.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index d6d95d78833e..bd191bbf4db9 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -20,6 +20,7 @@
#include "Paint.hxx"
#include "SidebarResource.hxx"
#include "sfx2/sidebar/Tools.hxx"
+#include <sfx2/app.hxx>
#include <tools/svborder.hxx>
#include <tools/rc.hxx>
@@ -31,25 +32,13 @@ using namespace cssu;
namespace sfx2 { namespace sidebar {
-::rtl::Reference<Theme> Theme::mpInstance;
-
-
-
-Theme& Theme::GetCurrentTheme (void)
+Theme& Theme::GetCurrentTheme()
{
- if ( ! mpInstance.is())
- {
- mpInstance.set(new Theme());
- mpInstance->InitializeTheme();
- }
- return *mpInstance;
+ return SFX_APP()->GetSidebarTheme();
}
-
-
-
-Theme::Theme (void)
+Theme::Theme()
: ThemeInterfaceBase(m_aMutex),
maImages(),
maColors(),