From ae9aa7ec231ce62337286715de5a2efd65418e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Tue, 1 Aug 2023 19:45:25 +0300 Subject: [PATCH] mshtml: Use unlink and destructor in the vtbl for CSSStyle. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlstyle.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 766a9306b05..b696a155fc2 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -4772,12 +4772,8 @@ static ULONG WINAPI HTMLCSSStyleDeclaration_Release(IHTMLCSSStyleDeclaration *if TRACE("(%p) ref=%ld\n", This, ref); - if(!ref) { - if(This->nsstyle) - nsIDOMCSSStyleDeclaration_Release(This->nsstyle); + if(!ref) release_dispex(&This->dispex); - free(This); - } return ref; } @@ -9969,6 +9965,18 @@ static inline CSSStyle *impl_from_DispatchEx(DispatchEx *dispex) return CONTAINING_RECORD(dispex, CSSStyle, dispex); } +static void CSSStyle_unlink(DispatchEx *dispex) +{ + CSSStyle *This = impl_from_DispatchEx(dispex); + unlink_ref(&This->nsstyle); +} + +static void CSSStyle_destructor(DispatchEx *dispex) +{ + CSSStyle *This = impl_from_DispatchEx(dispex); + free(This); +} + static HRESULT CSSStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) { CSSStyle *This = impl_from_DispatchEx(dispex); @@ -9997,8 +10005,8 @@ void CSSStyle_init_dispex_info(dispex_data_t *info, compat_mode_t mode) } const dispex_static_data_vtbl_t CSSStyle_dispex_vtbl = { - NULL, - NULL, + CSSStyle_destructor, + CSSStyle_unlink, NULL, CSSStyle_get_dispid, NULL,