Browse Source

Weather: Fix and free event registration tokens

pull/1138/head
Valentin Radu 4 years ago
parent
commit
5093e7de37
  1. 8
      ep_weather_host/ep_weather_host.c
  2. 4
      ep_weather_host/ep_weather_host.h

8
ep_weather_host/ep_weather_host.c

@ -1375,6 +1375,14 @@ DWORD WINAPI epw_Weather_MainThread(EPWeather* _this) @@ -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);

4
ep_weather_host/ep_weather_host.h

@ -78,8 +78,8 @@ typedef interface EPWeather @@ -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;

Loading…
Cancel
Save