From 022e7f2466f166db0864d3d6c26ee749f4a19f0b Mon Sep 17 00:00:00 2001 From: RadAd Date: Wed, 30 Nov 2022 16:52:02 +1100 Subject: [PATCH] Fix for RemoveDesktop --- src/VDUtils.cpp | 3 ++- src/VirtualDesktop.rc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/VDUtils.cpp b/src/VDUtils.cpp index 51570d1..4303776 100644 --- a/src/VDUtils.cpp +++ b/src/VDUtils.cpp @@ -333,12 +333,13 @@ void CreateDesktop(LogF* pLog, void* logdata) template void RemoveDesktop(LogF* pLog, void* logdata, VDMI* pDesktopManagerInternal, int d) { - CComPtr pDesktop = GetDesktop(pLog, logdata, pDesktopManagerInternal, d); CComPtr pCurrentDesktop; LogHR(pLog, logdata, GetCurrentDesktop(pDesktopManagerInternal, &pCurrentDesktop), L"GetCurrentDesktop"); + CComPtr pDesktop = d == -1 ? pCurrentDesktop : GetDesktop(pLog, logdata, pDesktopManagerInternal, d); CComPtr pFallbackDesktop = pCurrentDesktop; if (!pFallbackDesktop || pFallbackDesktop.IsEqualObject(pDesktop)) { + pFallbackDesktop.Release(); LogHR(pLog, logdata, pDesktopManagerInternal->GetAdjacentDesktop(pCurrentDesktop, AdjacentDesktop::RightDirection, &pFallbackDesktop), TYPE_E_OUTOFBOUNDS, L"GetAdjacentDesktop"); if (!pFallbackDesktop) LogHR(pLog, logdata, pDesktopManagerInternal->GetAdjacentDesktop(pCurrentDesktop, AdjacentDesktop::LeftDirection, &pFallbackDesktop), TYPE_E_OUTOFBOUNDS, L"GetAdjacentDesktop"); diff --git a/src/VirtualDesktop.rc b/src/VirtualDesktop.rc index 41a9259..d0f2fa9 100644 --- a/src/VirtualDesktop.rc +++ b/src/VirtualDesktop.rc @@ -8,7 +8,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,3,1,0 + FILEVERSION 1,3,2,0 PRODUCTVERSION 3,0,2,2161 FILEFLAGSMASK 0x17L #ifdef _DEBUG @@ -24,7 +24,7 @@ BEGIN BEGIN BLOCK "040904E4" BEGIN - VALUE "FileVersion", "1.3.1.0" + VALUE "FileVersion", "1.3.2.0" VALUE "LegalCopyright", "© 2021 - Adam Gates" // Don't change the entries below!