diff --git a/ep_weather_host/ep_weather_host.c b/ep_weather_host/ep_weather_host.c index 1b59226..4415057 100644 --- a/ep_weather_host/ep_weather_host.c +++ b/ep_weather_host/ep_weather_host.c @@ -1375,6 +1375,14 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this) cleanup: + if (_this->tkOnNavigationCompleted.value) + { + _this->pCoreWebView2->lpVtbl->remove_NavigationCompleted(_this->pCoreWebView2, _this->tkOnNavigationCompleted); + } + if (_this->tkOnPermissionRequested.value) + { + _this->pCoreWebView2->lpVtbl->remove_PermissionRequested(_this->pCoreWebView2, _this->tkOnPermissionRequested); + } if (_this->pCoreWebView2) { _this->pCoreWebView2->lpVtbl->Release(_this->pCoreWebView2); diff --git a/ep_weather_host/ep_weather_host.h b/ep_weather_host/ep_weather_host.h index b9568b1..19182e4 100644 --- a/ep_weather_host/ep_weather_host.h +++ b/ep_weather_host/ep_weather_host.h @@ -78,8 +78,8 @@ typedef interface EPWeather ITaskbarList* pTaskList; ICoreWebView2Controller* pCoreWebView2Controller; ICoreWebView2* pCoreWebView2; - EventRegistrationToken* tkOnNavigationCompleted; - EventRegistrationToken* tkOnPermissionRequested; + EventRegistrationToken tkOnNavigationCompleted; + EventRegistrationToken tkOnPermissionRequested; RECT rc; LONG64 dpiXInitial; LONG64 dpiYInitial;