[SHIMGVW] Destroy window to exit app in Preview_Edit

CORE-19358
This commit is contained in:
Katayama Hirofumi MZ 2023-12-11 15:51:55 +09:00
parent 2de6e7559e
commit a837138dfc

View file

@ -905,6 +905,14 @@ Preview_Edit(HWND hwnd)
if (!g_pCurrentFile) if (!g_pCurrentFile)
return; 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); GetFullPathNameW(g_pCurrentFile->FileName, _countof(szPathName), szPathName, NULL);
szPathName[_countof(szPathName) - 1] = UNICODE_NULL; /* Avoid buffer overrun */ 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()); DPRINT1("Preview_Edit: ShellExecuteExW() failed with code %ld\n", GetLastError());
} }
// Destroy the window to quit the application
DestroyWindow(hwnd);
} }
static VOID static VOID