Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6bd162d9
Commit
6bd162d9
authored
Mar 08, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Mar 09, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Grab refs to windows upfront before sending pagehide events.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
3c2b4171
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
11 deletions
+39
-11
view.c
dlls/mshtml/view.c
+39
-11
No files found.
dlls/mshtml/view.c
View file @
6bd162d9
...
@@ -414,14 +414,48 @@ HRESULT call_set_active_object(IOleInPlaceUIWindow *window, IOleInPlaceActiveObj
...
@@ -414,14 +414,48 @@ HRESULT call_set_active_object(IOleInPlaceUIWindow *window, IOleInPlaceActiveObj
return
IOleInPlaceUIWindow_SetActiveObject
(
window
,
act_obj
,
act_obj
?
html_documentW
:
NULL
);
return
IOleInPlaceUIWindow_SetActiveObject
(
window
,
act_obj
,
act_obj
?
html_documentW
:
NULL
);
}
}
static
void
send_unload_events_impl
(
HTMLInnerWindow
*
window
)
static
unsigned
get_window_list_num
(
HTMLInnerWindow
*
window
)
{
{
HTMLOuterWindow
*
child
;
HTMLOuterWindow
*
child
;
unsigned
ret
=
1
;
LIST_FOR_EACH_ENTRY
(
child
,
&
window
->
children
,
HTMLOuterWindow
,
sibling_entry
)
ret
+=
get_window_list_num
(
child
->
base
.
inner_window
);
return
ret
;
}
static
HTMLInnerWindow
**
get_window_list
(
HTMLInnerWindow
*
window
,
HTMLInnerWindow
**
output
)
{
HTMLOuterWindow
*
child
;
*
output
++
=
window
;
IHTMLWindow2_AddRef
(
&
window
->
base
.
IHTMLWindow2_iface
);
LIST_FOR_EACH_ENTRY
(
child
,
&
window
->
children
,
HTMLOuterWindow
,
sibling_entry
)
output
=
get_window_list
(
child
->
base
.
inner_window
,
output
);
return
output
;
}
static
void
send_unload_events
(
HTMLDocumentObj
*
doc
)
{
HTMLInnerWindow
**
windows
,
*
window
;
DOMEvent
*
event
;
DOMEvent
*
event
;
unsigned
i
,
num
;
HRESULT
hres
;
HRESULT
hres
;
if
(
!
window
)
if
(
!
doc
->
window
||
!
doc
->
doc_node
->
content_ready
)
return
;
window
=
doc
->
window
->
base
.
inner_window
;
/* Grab list of all windows ahead, and keep refs,
since it can be detached from under our feet. */
num
=
get_window_list_num
(
window
);
if
(
!
(
windows
=
malloc
(
num
*
sizeof
(
*
windows
))))
return
;
return
;
get_window_list
(
window
,
windows
);
for
(
i
=
0
;
i
<
num
;
i
++
)
{
window
=
windows
[
i
];
if
(
window
->
doc
&&
!
window
->
doc
->
unload_sent
)
{
if
(
window
->
doc
&&
!
window
->
doc
->
unload_sent
)
{
window
->
doc
->
unload_sent
=
TRUE
;
window
->
doc
->
unload_sent
=
TRUE
;
...
@@ -443,16 +477,10 @@ static void send_unload_events_impl(HTMLInnerWindow *window)
...
@@ -443,16 +477,10 @@ static void send_unload_events_impl(HTMLInnerWindow *window)
}
}
}
}
LIST_FOR_EACH_ENTRY
(
child
,
&
window
->
children
,
HTMLOuterWindow
,
sibling_entry
)
IHTMLWindow2_Release
(
&
window
->
base
.
IHTMLWindow2_iface
);
send_unload_events_impl
(
child
->
base
.
inner_window
);
}
}
static
void
send_unload_events
(
HTMLDocumentObj
*
doc
)
{
if
(
!
doc
->
window
||
!
doc
->
doc_node
->
content_ready
)
return
;
send_unload_events_impl
(
doc
->
window
->
base
.
inner_window
);
free
(
windows
);
}
}
/**********************************************************
/**********************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment