1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

uiautomationcore: Release node lresult upon failure to allocate a node in uia_node_from_lresult().

Signed-off-by: Connor McAdams <cmcadams@codeweavers.com>
This commit is contained in:
Connor McAdams 2023-10-11 11:51:54 -04:00 committed by Alexandre Julliard
parent 48e110e0fd
commit 0592872161
3 changed files with 12 additions and 8 deletions

View file

@ -2572,7 +2572,10 @@ HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode)
hr = create_uia_node(&node, 0);
if (FAILED(hr))
{
uia_node_lresult_release(lr);
return hr;
}
uia_start_client_thread();
hr = create_wine_uia_nested_node_provider(node, lr, FALSE);
@ -2601,6 +2604,14 @@ HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode)
return hr;
}
void uia_node_lresult_release(LRESULT lr)
{
IWineUiaNode *node;
if (lr && SUCCEEDED(ObjectFromLresult(lr, &IID_IWineUiaNode, 0, (void **)&node)))
IWineUiaNode_Release(node);
}
/*
* UiaNodeFromHandle is expected to work even if the calling thread hasn't
* initialized COM. We marshal our node on a separate thread that initializes

View file

@ -588,14 +588,6 @@ static struct uia_queue_event *uia_event_queue_pop(struct list *event_queue)
return queue_event;
}
static void uia_node_lresult_release(LRESULT lr)
{
IWineUiaNode *node;
if (lr && SUCCEEDED(ObjectFromLresult(lr, &IID_IWineUiaNode, 0, (void **)&node)))
IWineUiaNode_Release(node);
}
static HRESULT uia_event_invoke(HUIANODE node, HUIANODE nav_start_node, struct uia_event_args *args,
struct uia_event *event);
static HRESULT uia_raise_clientside_event(struct uia_queue_uia_event *event)

View file

@ -219,6 +219,7 @@ HRESULT navigate_uia_node(struct uia_node *node, int nav_dir, HUIANODE *out_node
HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE *out_node,
BOOL get_hwnd_providers, int node_flags) DECLSPEC_HIDDEN;
HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode) DECLSPEC_HIDDEN;
void uia_node_lresult_release(LRESULT lr) DECLSPEC_HIDDEN;
HRESULT create_uia_node_from_hwnd(HWND hwnd, HUIANODE *out_node, int node_flags) DECLSPEC_HIDDEN;
HRESULT uia_condition_check(HUIANODE node, struct UiaCondition *condition) DECLSPEC_HIDDEN;
BOOL uia_condition_matched(HRESULT hr) DECLSPEC_HIDDEN;