Module: wine Branch: master Commit: cfe112d70c278527abda07cf1af824940e14f1e2 URL: https://gitlab.winehq.org/wine/wine/-/commit/cfe112d70c278527abda07cf1af8249...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Tue Aug 1 19:45:25 2023 +0300
mshtml: Use unlink and destructor in the vtbl for HTMLStyleSheetsCollection.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmlstylesheet.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 336f4d41edf..02c46195314 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -703,12 +703,8 @@ static ULONG WINAPI HTMLStyleSheetsCollection_Release(IHTMLStyleSheetsCollection
TRACE("(%p) ref=%ld\n", This, ref);
- if(!ref) { + if(!ref) release_dispex(&This->dispex); - if(This->nslist) - nsIDOMStyleSheetList_Release(This->nslist); - free(This); - }
return ref; } @@ -844,6 +840,18 @@ static inline HTMLStyleSheetsCollection *HTMLStyleSheetsCollection_from_Dispatch return CONTAINING_RECORD(iface, HTMLStyleSheetsCollection, dispex); }
+static void HTMLStyleSheetsCollection_unlink(DispatchEx *dispex) +{ + HTMLStyleSheetsCollection *This = HTMLStyleSheetsCollection_from_DispatchEx(dispex); + unlink_ref(&This->nslist); +} + +static void HTMLStyleSheetsCollection_destructor(DispatchEx *dispex) +{ + HTMLStyleSheetsCollection *This = HTMLStyleSheetsCollection_from_DispatchEx(dispex); + free(This); +} + static HRESULT HTMLStyleSheetsCollection_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags, DISPID *dispid) { HTMLStyleSheetsCollection *This = HTMLStyleSheetsCollection_from_DispatchEx(dispex); @@ -921,8 +929,8 @@ static HRESULT HTMLStyleSheetsCollection_invoke(DispatchEx *dispex, DISPID id, L }
static const dispex_static_data_vtbl_t HTMLStyleSheetsCollection_dispex_vtbl = { - NULL, - NULL, + HTMLStyleSheetsCollection_destructor, + HTMLStyleSheetsCollection_unlink, NULL, HTMLStyleSheetsCollection_get_dispid, HTMLStyleSheetsCollection_get_name,