diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 19:07:20 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 19:07:20 +0000 |
commit | 37995b910417cef0823bccb4957a962a02a6d233 (patch) | |
tree | bcb8a8a4e43719e8f874244fa02725f027cabb9a /ui/gfx/native_theme_android.cc | |
parent | aa22b24e681201499f9dc82c3d62d66e682bf118 (diff) | |
download | chromium_src-37995b910417cef0823bccb4957a962a02a6d233.zip chromium_src-37995b910417cef0823bccb4957a962a02a6d233.tar.gz chromium_src-37995b910417cef0823bccb4957a962a02a6d233.tar.bz2 |
Fix statics in NativeTheme*::instance() to avoid destruction post main
Intentionally leaks NativeTheme* singletons to avoid destructor firing after main. Memory bots will need suppressions for this.
Avoids clang error:
time make -k -j16 compositor_unittests
CXX(target) out/Debug/obj.target/ui/ui/gfx/native_theme_aura.o
ui/gfx/native_theme_aura.cc:27:32: error: declaration requires an exit-time destructor [-Werror,-Wexit-time-destructors]
static const NativeThemeAura s_native_theme;
BUG=none
TEST=compiles under clang -Wexit-time-destructors
R=jamescook@chromium.org, ben@chromium.org
Review URL: http://codereview.chromium.org/8520026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/native_theme_android.cc')
-rw-r--r-- | ui/gfx/native_theme_android.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/gfx/native_theme_android.cc b/ui/gfx/native_theme_android.cc index 23d6cba..d570f5f 100644 --- a/ui/gfx/native_theme_android.cc +++ b/ui/gfx/native_theme_android.cc @@ -6,6 +6,7 @@ #include <limits> +#include "base/basictypes.h" #include "base/logging.h" #include "grit/gfx_resources.h" #include "third_party/skia/include/effects/SkGradientShader.h" @@ -52,8 +53,7 @@ static SkColor BrightenColor(const color_utils::HSL& hsl, // static NativeThemeAndroid* NativeThemeAndroid::instance() { - // The global NativeThemeAndroid instance. - static NativeThemeAndroid s_native_theme; + CR_DEFINE_STATIC_LOCAL(NativeThemeAndroid, s_native_theme, ()); return &s_native_theme; } |