Commit 1904dd0b authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Use unlink and destructor in the vtbl for HTMLTxtRange.

parent 5c3f4e4b
...@@ -855,14 +855,8 @@ static ULONG WINAPI HTMLTxtRange_Release(IHTMLTxtRange *iface) ...@@ -855,14 +855,8 @@ static ULONG WINAPI HTMLTxtRange_Release(IHTMLTxtRange *iface)
TRACE("(%p) ref=%ld\n", This, ref); TRACE("(%p) ref=%ld\n", This, ref);
if(!ref) { if(!ref)
if(This->nsrange)
nsIDOMRange_Release(This->nsrange);
if(This->doc)
list_remove(&This->entry);
release_dispex(&This->dispex); release_dispex(&This->dispex);
free(This);
}
return ref; return ref;
} }
...@@ -1718,13 +1712,39 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = { ...@@ -1718,13 +1712,39 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
RangeCommandTarget_Exec RangeCommandTarget_Exec
}; };
static inline HTMLTxtRange *HTMLTxtRange_from_DispatchEx(DispatchEx *iface)
{
return CONTAINING_RECORD(iface, HTMLTxtRange, dispex);
}
static void HTMLTxtRange_unlink(DispatchEx *dispex)
{
HTMLTxtRange *This = HTMLTxtRange_from_DispatchEx(dispex);
unlink_ref(&This->nsrange);
if(This->doc) {
This->doc = NULL;
list_remove(&This->entry);
}
}
static void HTMLTxtRange_destructor(DispatchEx *dispex)
{
HTMLTxtRange *This = HTMLTxtRange_from_DispatchEx(dispex);
free(This);
}
static const dispex_static_data_vtbl_t HTMLTxtRange_dispex_vtbl = {
HTMLTxtRange_destructor,
HTMLTxtRange_unlink
};
static const tid_t HTMLTxtRange_iface_tids[] = { static const tid_t HTMLTxtRange_iface_tids[] = {
IHTMLTxtRange_tid, IHTMLTxtRange_tid,
0 0
}; };
static dispex_static_data_t HTMLTxtRange_dispex = { static dispex_static_data_t HTMLTxtRange_dispex = {
L"TextRange", L"TextRange",
NULL, &HTMLTxtRange_dispex_vtbl,
IHTMLTxtRange_tid, IHTMLTxtRange_tid,
HTMLTxtRange_iface_tids HTMLTxtRange_iface_tids
}; };
......
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