diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/svapp.hxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index dcd1374fa3f5..d5f1739be1ae 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1414,8 +1414,16 @@ class SolarMutexReleaser { const sal_uInt32 mnReleased; public: - SolarMutexReleaser(): mnReleased(Application::ReleaseSolarMutex()) {} - ~SolarMutexReleaser() { Application::AcquireSolarMutex( mnReleased ); } + SolarMutexReleaser() + : mnReleased( + Application::GetSolarMutex().IsCurrentThread() ? Application::ReleaseSolarMutex() : 0) + { + } + ~SolarMutexReleaser() + { + if (mnReleased) + Application::AcquireSolarMutex(mnReleased); + } }; VCL_DLLPUBLIC Application* GetpApp(); |