diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-26 12:11:13 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-26 17:14:40 +0100 |
commit | 328416e015174778d11e982fd56f2cb59b0a5168 (patch) | |
tree | 5f410bf9f37395dc5119e9ec6a7ddc9611ffa366 /embeddedobj | |
parent | c15b872784c8fc0f5e5e813d38c7722f034034d2 (diff) |
This assert was wrong
In commit e2bfc34d146806a8f96be0cd2323d716f12cba4e (Reimplement
OleComponentNative_Impl to use IGlobalInterfaceTable, 2024-03-11),
I added the assert in a false assumption that RunObject may only
be called once. Indeed, this is not so. Thus just make sure to not
try to register it second time.
Change-Id: I36fc4f3939bd0061e462659749bba8e4bd3075ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165299
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/olecomponent.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx index edbeebb3c0b3..b9c1c27827bb 100644 --- a/embeddedobj/source/msole/olecomponent.cxx +++ b/embeddedobj/source/msole/olecomponent.cxx @@ -201,7 +201,8 @@ private: template <typename T> void registerInterface(T* pInterface, DWORD& cookie) { - assert(cookie == 0); // do not set again + if (cookie != 0) // E.g., on subsequent RunObject calls + return; HRESULT hr = m_pGlobalTable->RegisterInterfaceInGlobal(pInterface, __uuidof(T), &cookie); SAL_WARN_IF(FAILED(hr), "embeddedobj.ole", "RegisterInterfaceInGlobal failed"); } |