diff options
-rw-r--r-- | backends/platform/sdl/win32/win32.cpp | 1 | ||||
-rw-r--r-- | backends/taskbar/win32/win32-taskbar.cpp | 30 | ||||
-rw-r--r-- | backends/taskbar/win32/win32-taskbar.h | 2 |
3 files changed, 13 insertions, 20 deletions
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 0a6702b6d9..08139f0dc2 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -88,7 +88,6 @@ void OSystem_Win32::init() { #if defined(USE_TASKBAR) // Initialize taskbar manager _taskbarManager = new Win32TaskbarManager(); - ((Win32TaskbarManager *)_taskbarManager)->init(); #endif // Invoke parent implementation of this method diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp index c630129ea9..fd8cd263e8 100644 --- a/backends/taskbar/win32/win32-taskbar.cpp +++ b/backends/taskbar/win32/win32-taskbar.cpp @@ -51,19 +51,7 @@ const PROPERTYKEY PKEY_Title = { /* fmtid = */ { 0xF29F85E0, 0x4FF9, 0x1068, { 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9 } }, /* propID = */ 2 }; Win32TaskbarManager::Win32TaskbarManager() { - _taskbar = NULL; -} - -Win32TaskbarManager::~Win32TaskbarManager() { - if (_taskbar) - _taskbar->Release(); - _taskbar = NULL; - - CoUninitialize(); -} - -void Win32TaskbarManager::init() { - // Do nothing if not running on Windows 7 of later + // Do nothing if not running on Windows 7 or later if (!isWin7OrLater()) return; @@ -71,10 +59,10 @@ void Win32TaskbarManager::init() { // Try creating instance (on fail, _taskbar will contain NULL) HRESULT hr = CoCreateInstance(CLSID_TaskbarList, - 0, - CLSCTX_INPROC_SERVER, - IID_ITaskbarList3, - reinterpret_cast<void**> (&(_taskbar))); + 0, + CLSCTX_INPROC_SERVER, + IID_ITaskbarList3, + reinterpret_cast<void**> (&(_taskbar))); if (SUCCEEDED(hr)) { // Initialize taskbar object @@ -87,6 +75,14 @@ void Win32TaskbarManager::init() { } } +Win32TaskbarManager::~Win32TaskbarManager() { + if (_taskbar) + _taskbar->Release(); + _taskbar = NULL; + + CoUninitialize(); +} + void Win32TaskbarManager::setOverlayIcon(const Common::String &name, const Common::String &description) { //warning("[Win32TaskbarManager::setOverlayIcon] Setting overlay icon to: %s (%s)", name.c_str(), description.c_str()); diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h index 7d963c19ca..0fc219e816 100644 --- a/backends/taskbar/win32/win32-taskbar.h +++ b/backends/taskbar/win32/win32-taskbar.h @@ -38,8 +38,6 @@ public: Win32TaskbarManager(); virtual ~Win32TaskbarManager(); - void init(); - virtual void setOverlayIcon(const Common::String &name, const Common::String &description); virtual void setProgressValue(int completed, int total); virtual void setProgressState(TaskbarProgressState state); |