Skip to content

Commit

Permalink
Fix webview creation when using new_any_thread on Windows (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ngo Iok Ui (Wu Yu Wei) authored Jun 18, 2021
1 parent ba9b4e9 commit 4d62cf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/new_any_thread.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

Fix webview creation when using new_any_thread of event loop.
3 changes: 2 additions & 1 deletion src/webview/webview2/win32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
mod file_drop;

use crate::{
application::platform::windows::EventLoopExtWindows,
webview::{WebContext, WebViewAttributes},
Result,
};
Expand Down Expand Up @@ -215,7 +216,7 @@ impl InnerWebView {
})?;

// Wait until webview is actually created
let mut event_loop = EventLoop::new();
let mut event_loop: EventLoop<()> = EventLoop::new_any_thread();
let controller_clone = controller.clone();
let webview: Rc<OnceCell<WebView>> = Rc::new(OnceCell::new());
let webview_clone = webview.clone();
Expand Down

0 comments on commit 4d62cf5

Please sign in to comment.