media-session: fix cleanup of objects

Don't free the proxy twice in some cases.
This commit is contained in:
Wim Taymans 2020-01-28 15:37:51 +01:00
parent 281e61735b
commit d2d1647634

View file

@ -237,6 +237,8 @@ int sm_object_destroy(struct sm_object *obj)
pw_log_debug(NAME" %p: object %d", obj->session, obj->id); pw_log_debug(NAME" %p: object %d", obj->session, obj->id);
if (obj->proxy) { if (obj->proxy) {
pw_proxy_destroy(obj->proxy); pw_proxy_destroy(obj->proxy);
if (obj->handle == obj->proxy)
obj->handle = NULL;
obj->proxy = NULL; obj->proxy = NULL;
} }
if (obj->handle) { if (obj->handle) {
@ -521,8 +523,10 @@ static void node_destroy(void *object)
spa_list_remove(&node->link); spa_list_remove(&node->link);
node->device->obj.changed |= SM_DEVICE_CHANGE_MASK_NODES; node->device->obj.changed |= SM_DEVICE_CHANGE_MASK_NODES;
} }
if (node->info) if (node->info) {
pw_node_info_free(node->info); pw_node_info_free(node->info);
node->info = NULL;
}
} }
static const struct object_info node_info = { static const struct object_info node_info = {