Module: wine Branch: master Commit: d373377765f1e5d6722071626d9072d5b2c72402 URL: https://gitlab.winehq.org/wine/wine/-/commit/d373377765f1e5d6722071626d9072d...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Thu Aug 3 15:56:13 2023 +0300
mshtml: Use unlink and destructor in the vtbl for History.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
---
dlls/mshtml/omnavigator.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index b3dbcb8020b..4de420c6961 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -656,10 +656,8 @@ static ULONG WINAPI OmHistory_Release(IOmHistory *iface)
TRACE("(%p) ref=%ld\n", This, ref);
- if(!ref) { + if(!ref) release_dispex(&This->dispex); - free(This); - }
return ref; } @@ -748,13 +746,28 @@ static const IOmHistoryVtbl OmHistoryVtbl = { OmHistory_go };
+static inline OmHistory *OmHistory_from_DispatchEx(DispatchEx *iface) +{ + return CONTAINING_RECORD(iface, OmHistory, dispex); +} + +static void OmHistory_destructor(DispatchEx *dispex) +{ + OmHistory *This = OmHistory_from_DispatchEx(dispex); + free(This); +} + +static const dispex_static_data_vtbl_t OmHistory_dispex_vtbl = { + OmHistory_destructor, +}; + static const tid_t OmHistory_iface_tids[] = { IOmHistory_tid, 0 }; static dispex_static_data_t OmHistory_dispex = { L"History", - NULL, + &OmHistory_dispex_vtbl, DispHTMLHistory_tid, OmHistory_iface_tids };