diff --git a/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp b/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp index ca0241b0..52861867 100644 --- a/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp +++ b/src/wx/autoupdater/wxmsw/winsparkle-wrapper.cpp @@ -40,27 +40,25 @@ WinSparkleDllWrapper::WinSparkleDllWrapper() temp_file.Write((void *)res_data, res_size); temp_file.Close(); - winsparkle_dll = new wxDynamicLibrary(temp_file_name, wxDL_NOW | wxDL_VERBATIM); + winsparkle_dll = LoadLibraryW(temp_file_name.wc_str()); if (winsparkle_dll != nullptr) { - winsparkle_init = reinterpret_cast(winsparkle_dll->GetSymbol("win_sparkle_init")); - winsparkle_check_update_with_ui = reinterpret_cast(winsparkle_dll->GetSymbol("win_sparkle_check_update_with_ui")); - winsparkle_set_appcast_url = reinterpret_cast(winsparkle_dll->GetSymbol("win_sparkle_set_appcast_url")); - winsparkle_set_app_details = reinterpret_cast(winsparkle_dll->GetSymbol("win_sparkle_set_app_details")); - winsparkle_cleanup = reinterpret_cast(winsparkle_dll->GetSymbol("win_sparkle_cleanup")); + winsparkle_init = reinterpret_cast(GetProcAddress(winsparkle_dll, "win_sparkle_init")); + winsparkle_check_update_with_ui = reinterpret_cast(GetProcAddress(winsparkle_dll, "win_sparkle_check_update_with_ui")); + winsparkle_set_appcast_url = reinterpret_cast(GetProcAddress(winsparkle_dll, "win_sparkle_set_appcast_url")); + winsparkle_set_app_details = reinterpret_cast(GetProcAddress(winsparkle_dll, "win_sparkle_set_app_details")); + winsparkle_cleanup = reinterpret_cast(winsparkle_dll->GetProcAddress(winsparkle_dll, "win_sparkle_cleanup")); } } WinSparkleDllWrapper::~WinSparkleDllWrapper() { - HMODULE hmod = winsparkle_dll->Detach(); - if (hmod != nullptr) { - while(::FreeLibrary(hmod)) { - wxMilliSleep(50); + if (winsparkle_dll != nullptr) { + while(::FreeLibrary(winsparkle_dll)) { + wxMilliSleep(200); } } - delete winsparkle_dll; if (!temp_file_name) { return; // No need to delete the file if it was never created. diff --git a/src/wx/autoupdater/wxmsw/winsparkle-wrapper.h b/src/wx/autoupdater/wxmsw/winsparkle-wrapper.h index 65791bd6..39021538 100644 --- a/src/wx/autoupdater/wxmsw/winsparkle-wrapper.h +++ b/src/wx/autoupdater/wxmsw/winsparkle-wrapper.h @@ -20,7 +20,7 @@ private: WinSparkleDllWrapper(); ~WinSparkleDllWrapper(); - wxDynamicLibrary *winsparkle_dll; + HMODULE winsparkle_dll; func_win_sparkle_init winsparkle_init = nullptr; func_win_sparkle_check_update_with_ui winsparkle_check_update_with_ui = nullptr; diff --git a/win32-deps b/win32-deps index d2e68f16..855244e2 160000 --- a/win32-deps +++ b/win32-deps @@ -1 +1 @@ -Subproject commit d2e68f1641010efb05985e1992bf4c76abaf9947 +Subproject commit 855244e2525ccdaff9d0cf534cfa95ef7b549df7