Module: wine Branch: master Commit: df6316cdbc802c951738f3bd257f630a3428ac56 URL: https://gitlab.winehq.org/wine/wine/-/commit/df6316cdbc802c951738f3bd257f630...
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 HTMLImageElementFactory.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/htmlimg.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index e0ade235c01..cc091429500 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -808,10 +808,8 @@ static ULONG WINAPI HTMLImageElementFactory_Release(IHTMLImageElementFactory *if
TRACE("(%p) ref=%ld\n", This, ref);
- if(!ref) { + if(!ref) release_dispex(&This->dispex); - free(This); - }
return ref; } @@ -941,6 +939,12 @@ static inline HTMLImageElementFactory *impl_from_DispatchEx(DispatchEx *iface) return CONTAINING_RECORD(iface, HTMLImageElementFactory, dispex); }
+static void HTMLImageElementFactory_destructor(DispatchEx *dispex) +{ + HTMLImageElementFactory *This = impl_from_DispatchEx(dispex); + free(This); +} + static HRESULT HTMLImageElementFactory_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) @@ -975,7 +979,7 @@ static const tid_t HTMLImageElementFactory_iface_tids[] = { };
static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { - NULL, + HTMLImageElementFactory_destructor, NULL, HTMLImageElementFactory_value, NULL,