From 9541020f16eca589fb147c52bc59a1cad2e1dc2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Thu, 3 Aug 2023 15:56:12 +0300 Subject: [PATCH] mshtml: Use unlink and destructor in the vtbl for HTMLStorage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/mshtml/htmlstorage.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index da97809177b..cad2b2dbd32 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -397,14 +397,8 @@ static ULONG WINAPI HTMLStorage_Release(IHTMLStorage *iface) TRACE("(%p) ref=%ld\n", This, ref); - if(!ref) { - release_session_map_entry(This->session_storage); + if(!ref) release_dispex(&This->dispex); - free(This->filename); - CloseHandle(This->mutex); - release_props(This); - free(This); - } return ref; } @@ -1063,6 +1057,16 @@ static inline HTMLStorage *impl_from_DispatchEx(DispatchEx *iface) return CONTAINING_RECORD(iface, HTMLStorage, dispex); } +static void HTMLStorage_destructor(DispatchEx *dispex) +{ + HTMLStorage *This = impl_from_DispatchEx(dispex); + release_session_map_entry(This->session_storage); + free(This->filename); + CloseHandle(This->mutex); + release_props(This); + free(This); +} + static HRESULT check_item(HTMLStorage *This, const WCHAR *key) { struct session_entry *session_entry; @@ -1308,7 +1312,7 @@ static HRESULT HTMLStorage_next_dispid(DispatchEx *dispex, DISPID id, DISPID *pi } static const dispex_static_data_vtbl_t HTMLStorage_dispex_vtbl = { - NULL, + HTMLStorage_destructor, NULL, NULL, HTMLStorage_get_dispid,