[0.4.9][APPWIZ] Don't hung up in Gecko download cancellation #3049 CORE-14538

Do not call EndDialog outside the dialog procedure.

fix picked from commit 0.4.15-dev-511-g 90456e54a4

This hang/crash in 2nd stage setup did *not* affect our official carrier-releaser isos that
we host on sourceforge, because those come bundled with Gecko already and therefore always
skipped the download.
Most users were safe in the past therefore.
Still everyone that would like to build an iso by himself could potentially run
into those crashes, and it did not only happen upon user-driven cancellation,
but also often crashed upon network failure / timeout.
A very important fix therefore.
For some unknown reason the likelihood of this crash gradually increased from
0.4.7 where it happened almost never, until 0.4.14 where it crashed much more likely.
Not well understood, maybe depends on memory layout or something similar.
This commit is contained in:
Joachim Henze 2021-01-17 22:45:00 +01:00
parent 11b2653a65
commit 7bbe9f94ba

View file

@ -59,7 +59,7 @@ static const addon_info_t addons_info[] = {
static const addon_info_t *addon;
static HWND install_dialog = NULL;
static IBinding *download_binding;
static IBinding *download_binding = NULL;
static WCHAR GeckoUrl[] = L"https://svn.reactos.org/amine/wine_gecko-2.40-x86.msi";
@ -375,7 +375,7 @@ static DWORD WINAPI download_proc(PVOID arg)
}
DeleteFileW(tmp_file);
EndDialog(install_dialog, 0);
PostMessageW(install_dialog, WM_COMMAND, IDCANCEL, 0);
return 0;
}