mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2026-01-11 18:37:34 +00:00
ovirt: Fix OvirtApi memory handling
The oVirt integration code in remote-viewer assumes that
the caller owns a reference on the OvirtApi instance returned
by ovirt_proxy_fetch_api{,finish}.
This is incorrect as these 2 API calls have always been documented as
being (transfer none). This was working so far because libgovirt was
leaking an OvirtApi reference. This bug is fixed upstream, so we now get
a warning on remote-viewer exit about trying to unref an invalid object.
This commit fixes that by taking the ref we expect in OvirtForeignMenu,
and by not releasing a ref we do not own in remote-viewer.c
This commit is contained in:
parent
7a7143245a
commit
9aa7aec9a9
@ -759,6 +759,7 @@ static void api_fetched_cb(GObject *source_object,
|
||||
return;
|
||||
}
|
||||
g_return_if_fail(OVIRT_IS_API(menu->priv->api));
|
||||
g_object_ref(menu->priv->api);
|
||||
|
||||
ovirt_foreign_menu_next_async_step(menu, STATE_API);
|
||||
}
|
||||
|
||||
@ -997,8 +997,6 @@ error:
|
||||
g_object_unref(display);
|
||||
if (vm != NULL)
|
||||
g_object_unref(vm);
|
||||
if (api != NULL)
|
||||
g_object_unref(api);
|
||||
if (proxy != NULL)
|
||||
g_object_unref(proxy);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user