From ee24cfe6beb2e98eb8dfee4329eecfb22813b5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Fri, 4 Aug 2023 17:30:15 +0300 Subject: [PATCH] mshtml: Use unlink and destructor in the vtbl for DOMTokenList. 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 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 112057030d3..9542d43d5dc 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7427,11 +7427,8 @@ static ULONG WINAPI token_list_Release(IWineDOMTokenList *iface) TRACE("(%p) ref=%ld\n", token_list, ref); - if(!ref) { - IHTMLElement_Release(token_list->element); + if(!ref) release_dispex(&token_list->dispex); - free(token_list); - } return ref; } @@ -7750,6 +7747,18 @@ static inline struct token_list *token_list_from_DispatchEx(DispatchEx *iface) return CONTAINING_RECORD(iface, struct token_list, dispex); } +static void token_list_unlink(DispatchEx *dispex) +{ + struct token_list *token_list = token_list_from_DispatchEx(dispex); + unlink_ref(&token_list->element); +} + +static void token_list_destructor(DispatchEx *dispex) +{ + struct token_list *token_list = token_list_from_DispatchEx(dispex); + free(token_list); +} + static HRESULT token_list_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -7825,8 +7834,8 @@ static HRESULT token_list_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD } static const dispex_static_data_vtbl_t token_list_dispex_vtbl = { - NULL, - NULL, + token_list_destructor, + token_list_unlink, token_list_value, token_list_get_dispid, token_list_get_name,