From 64c7a01ebb585ba4d0aed0d96cbf2b44d636601d Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Wed, 16 Oct 2013 15:38:36 +0000 Subject: [PATCH] fixed: synergys crashes on exit. --- src/lib/platform/CMSWindowsScreen.cpp | 12 ++++++++++-- src/lib/platform/CMSWindowsScreen.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/platform/CMSWindowsScreen.cpp b/src/lib/platform/CMSWindowsScreen.cpp index 3f46ea40..7efe6c32 100644 --- a/src/lib/platform/CMSWindowsScreen.cpp +++ b/src/lib/platform/CMSWindowsScreen.cpp @@ -163,7 +163,7 @@ CMSWindowsScreen::CMSWindowsScreen( closeHookLibrary(m_hookLibrary); if (m_shellLibrary != NULL) - closeHookLibrary(m_shellLibrary); + closeShellLibrary(m_shellLibrary); s_screen = NULL; throw; @@ -195,7 +195,7 @@ CMSWindowsScreen::~CMSWindowsScreen() closeHookLibrary(m_hookLibrary); if (m_shellLibrary != NULL) - closeHookLibrary(m_shellLibrary); + closeShellLibrary(m_shellLibrary); s_screen = NULL; } @@ -825,6 +825,14 @@ CMSWindowsScreen::closeHookLibrary(HINSTANCE hookLibrary) const } } +void +CMSWindowsScreen::closeShellLibrary(HINSTANCE shellLibrary) const +{ + if (shellLibrary != NULL) { + FreeLibrary(shellLibrary); + } +} + HCURSOR CMSWindowsScreen::createBlankCursor() const { diff --git a/src/lib/platform/CMSWindowsScreen.h b/src/lib/platform/CMSWindowsScreen.h index 51414d01..ed7957e1 100644 --- a/src/lib/platform/CMSWindowsScreen.h +++ b/src/lib/platform/CMSWindowsScreen.h @@ -131,6 +131,7 @@ private: HINSTANCE openHookLibrary(const char* name); HINSTANCE openShellLibrary(const char* name); void closeHookLibrary(HINSTANCE hookLibrary) const; + void closeShellLibrary(HINSTANCE shellLibrary) const; HCURSOR createBlankCursor() const; void destroyCursor(HCURSOR cursor) const; ATOM createWindowClass() const;