Commit 57239e78 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use get_handler_vector in detach_event.

parent 3fcb5a0a
...@@ -1539,9 +1539,9 @@ HRESULT attach_event(EventTarget *event_target, BSTR name, IDispatch *disp, VARI ...@@ -1539,9 +1539,9 @@ HRESULT attach_event(EventTarget *event_target, BSTR name, IDispatch *disp, VARI
HRESULT detach_event(EventTarget *event_target, BSTR name, IDispatch *disp) HRESULT detach_event(EventTarget *event_target, BSTR name, IDispatch *disp)
{ {
event_target_t *data; handler_vector_t *handler_vector;
eventid_t eid; eventid_t eid;
DWORD i = 0; unsigned i;
eid = attr_to_eid(name); eid = attr_to_eid(name);
if(eid == EVENTID_LAST) { if(eid == EVENTID_LAST) {
...@@ -1549,19 +1549,15 @@ HRESULT detach_event(EventTarget *event_target, BSTR name, IDispatch *disp) ...@@ -1549,19 +1549,15 @@ HRESULT detach_event(EventTarget *event_target, BSTR name, IDispatch *disp)
return S_OK; return S_OK;
} }
data = get_event_target_data(event_target, FALSE); handler_vector = get_handler_vector(event_target, eid, FALSE);
if(!data) if(!handler_vector)
return S_OK;
if(!data->event_table[eid])
return S_OK; return S_OK;
while(i < data->event_table[eid]->handler_cnt) { for(i = 0; i < handler_vector->handler_cnt; i++) {
if(data->event_table[eid]->handlers[i] == disp) { if(handler_vector->handlers[i] == disp) {
IDispatch_Release(data->event_table[eid]->handlers[i]); IDispatch_Release(handler_vector->handlers[i]);
data->event_table[eid]->handlers[i] = NULL; handler_vector->handlers[i] = NULL;
} }
i++;
} }
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment