https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a837138dfcbbcfb2b60c12eca47f1f7c6d4e62db

commit a837138dfcbbcfb2b60c12eca47f1f7c6d4e62db
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Mon Dec 11 15:51:55 2023 +0900
Commit:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
CommitDate: Mon Dec 11 15:51:55 2023 +0900

    [SHIMGVW] Destroy window to exit app in Preview_Edit
    
    CORE-19358
---
 dll/win32/shimgvw/shimgvw.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dll/win32/shimgvw/shimgvw.c b/dll/win32/shimgvw/shimgvw.c
index fc3bbdbf2ec..cf62ba202ee 100644
--- a/dll/win32/shimgvw/shimgvw.c
+++ b/dll/win32/shimgvw/shimgvw.c
@@ -905,6 +905,14 @@ Preview_Edit(HWND hwnd)
     if (!g_pCurrentFile)
         return;
 
+    /* Avoid file locking */
+    /* FIXME: Our GdipLoadImageFromFile locks the image file */
+    if (g_pImage)
+    {
+        GdipDisposeImage(g_pImage);
+        g_pImage = NULL;
+    }
+
     GetFullPathNameW(g_pCurrentFile->FileName, _countof(szPathName), 
szPathName, NULL);
     szPathName[_countof(szPathName) - 1] = UNICODE_NULL; /* Avoid buffer 
overrun */
 
@@ -917,6 +925,9 @@ Preview_Edit(HWND hwnd)
     {
         DPRINT1("Preview_Edit: ShellExecuteExW() failed with code %ld\n", 
GetLastError());
     }
+
+    // Destroy the window to quit the application
+    DestroyWindow(hwnd);
 }
 
 static VOID

Reply via email to