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
60538b4c
Commit
60538b4c
authored
May 02, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
May 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Ensure that bind_event is not called multiple times for the same event.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
07156ad0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
htmlevent.c
dlls/mshtml/htmlevent.c
+12
-7
No files found.
dlls/mshtml/htmlevent.c
View file @
60538b4c
...
...
@@ -1386,6 +1386,7 @@ void detach_events(HTMLDocumentNode *doc)
release_nsevents
(
doc
);
}
/* Caller should ensure that it's called only once for given event in the target. */
static
void
bind_event
(
EventTarget
*
event_target
,
eventid_t
eid
)
{
if
(
event_target
->
dispex
.
data
->
vtbl
->
bind_event
)
...
...
@@ -1423,13 +1424,17 @@ static HRESULT set_event_handler_disp(EventTarget *event_target, eventid_t eid,
if
(
!
data
)
return
E_OUTOFMEMORY
;
if
(
!
alloc_handler_vector
(
data
,
eid
,
0
))
return
E_OUTOFMEMORY
;
if
(
!
data
->
event_table
[
eid
])
{
if
(
!
alloc_handler_vector
(
data
,
eid
,
0
))
return
E_OUTOFMEMORY
;
bind_event
(
event_target
,
eid
);
}
else
if
(
data
->
event_table
[
eid
]
->
handler_prop
)
{
IDispatch_Release
(
data
->
event_table
[
eid
]
->
handler_prop
);
}
data
->
event_table
[
eid
]
->
handler_prop
=
disp
;
IDispatch_AddRef
(
disp
);
bind_event
(
event_target
,
eid
);
return
S_OK
;
}
...
...
@@ -1522,15 +1527,15 @@ HRESULT attach_event(EventTarget *event_target, BSTR name, IDispatch *disp, VARI
i
++
;
if
(
i
==
data
->
event_table
[
eid
]
->
handler_cnt
&&
!
alloc_handler_vector
(
data
,
eid
,
i
+
1
))
return
E_OUTOFMEMORY
;
}
else
if
(
!
alloc_handler_vector
(
data
,
eid
,
i
+
1
))
{
}
else
if
(
alloc_handler_vector
(
data
,
eid
,
i
+
1
))
{
bind_event
(
event_target
,
eid
);
}
else
{
return
E_OUTOFMEMORY
;
}
IDispatch_AddRef
(
disp
);
data
->
event_table
[
eid
]
->
handlers
[
i
]
=
disp
;
bind_event
(
event_target
,
eid
);
*
res
=
VARIANT_TRUE
;
return
S_OK
;
}
...
...
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