From ab784433bcf9844cbba85af59c1a4351fdacd949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 4 Aug 2023 17:30:14 +0300 Subject: [PATCH] mshtml: Use unlink and destructor in the vtbl for HTMLRectCollection. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlelem.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 653bdd1e6b3..112057030d3 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1084,12 +1084,8 @@ static ULONG WINAPI HTMLRectCollection_Release(IHTMLRectCollection *iface) TRACE("(%p) ref=%ld\n", This, ref); - if(!ref) { - if(This->rect_list) - nsIDOMClientRectList_Release(This->rect_list); + if(!ref) release_dispex(&This->dispex); - free(This); - } return ref; } @@ -1212,6 +1208,18 @@ static inline HTMLRectCollection *HTMLRectCollection_from_DispatchEx(DispatchEx return CONTAINING_RECORD(iface, HTMLRectCollection, dispex); } +static void HTMLRectCollection_unlink(DispatchEx *dispex) +{ + HTMLRectCollection *This = HTMLRectCollection_from_DispatchEx(dispex); + unlink_ref(&This->rect_list); +} + +static void HTMLRectCollection_destructor(DispatchEx *dispex) +{ + HTMLRectCollection *This = HTMLRectCollection_from_DispatchEx(dispex); + free(This); +} + static HRESULT HTMLRectCollection_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) { HTMLRectCollection *This = HTMLRectCollection_from_DispatchEx(dispex); @@ -1287,8 +1295,8 @@ static HRESULT HTMLRectCollection_invoke(DispatchEx *dispex, DISPID id, LCID lci } static const dispex_static_data_vtbl_t HTMLRectCollection_dispex_vtbl = { - NULL, - NULL, + HTMLRectCollection_destructor, + HTMLRectCollection_unlink, NULL, HTMLRectCollection_get_dispid, HTMLRectCollection_get_name,