Module: wine Branch: master Commit: 7e08c8198e74879b864ebcaa5af8704f1bfdb1f0 URL: https://gitlab.winehq.org/wine/wine/-/commit/7e08c8198e74879b864ebcaa5af8704...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Fri Jul 12 20:12:25 2024 +0300
mshtml: Make sure we aren't detached before setting interactive ready state.
Once Human's EULA window uses InitNew during the parse_complete notifications, causing the window to become detached from the outer window, and ending up in a crash. But conceptually, even without the crash and somehow obtaining the current outer window, it doesn't make sense to touch it if it changed.
Spotted by Paul Gofman.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/mutation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index a502e3c9427..4e0276fd5f6 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -312,9 +312,9 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo
bind_event_scripts(This);
- if(This->window == window) { + if(This->window == window && window->base.outer_window) { window->dom_interactive_time = get_time_stamp(); - set_ready_state(This->window->base.outer_window, READYSTATE_INTERACTIVE); + set_ready_state(window->base.outer_window, READYSTATE_INTERACTIVE); } IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); return NS_OK;