Skip to content

Commit

Permalink
Free string returned by GetAvailableCoreWebView2BrowserVersionString (w…
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenL authored Jul 24, 2022
1 parent e6289ac commit 4bc32c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 1359,11 @@ class win32_edge_engine {
GetAvailableCoreWebView2BrowserVersionString(nullptr, &version_info);
// The result will be equal to HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
// if the WebView2 runtime is not installed.
return SUCCEEDED(res) && version_info;
auto ok = SUCCEEDED(res) && version_info;
if (version_info) {
CoTaskMemFree(version_info);
}
return ok;
}

virtual void on_message(const std::string &msg) = 0;
Expand Down

0 comments on commit 4bc32c9

Please sign in to comment.