Jacek Caban : mshtml: Include nsbody reference in cycle collection.
Module: wine Branch: master Commit: 278daad3bdd202283ea29c0089c19613efbe8f70 URL: http://source.winehq.org/git/wine.git/?a=commit;h=278daad3bdd202283ea29c0089... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Dec 21 19:29:35 2014 +0100 mshtml: Include nsbody reference in cycle collection. --- dlls/mshtml/htmlbody.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 7117087..748302e 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -805,13 +805,23 @@ static HRESULT HTMLBodyElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) return HTMLElement_QI(&This->textcont.element.node, riid, ppv); } -static void HTMLBodyElement_destructor(HTMLDOMNode *iface) +static void HTMLBodyElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb) { HTMLBodyElement *This = impl_from_HTMLDOMNode(iface); - nsIDOMHTMLBodyElement_Release(This->nsbody); + if(This->nsbody) + note_cc_edge((nsISupports*)This->nsbody, "This->nsbody", cb); +} + +static void HTMLBodyElement_unlink(HTMLDOMNode *iface) +{ + HTMLBodyElement *This = impl_from_HTMLDOMNode(iface); - HTMLElement_destructor(&This->textcont.element.node); + if(This->nsbody) { + nsIDOMHTMLBodyElement *nsbody = This->nsbody; + This->nsbody = NULL; + nsIDOMHTMLBodyElement_Release(nsbody); + } } static event_target_t **HTMLBodyElement_get_event_target(HTMLDOMNode *iface) @@ -832,12 +842,22 @@ static const cpc_entry_t HTMLBodyElement_cpc[] = { static const NodeImplVtbl HTMLBodyElementImplVtbl = { HTMLBodyElement_QI, - HTMLBodyElement_destructor, + HTMLElement_destructor, HTMLBodyElement_cpc, HTMLElement_clone, HTMLElement_handle_event, HTMLElement_get_attr_col, - HTMLBodyElement_get_event_target + HTMLBodyElement_get_event_target, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + HTMLBodyElement_traverse, + HTMLBodyElement_unlink }; static const tid_t HTMLBodyElement_iface_tids[] = {
participants (1)
-
Alexandre Julliard