fix some segfaults

This commit is contained in:
Wim Taymans 2020-01-16 16:47:01 +01:00
parent 6af00219e1
commit f792c3f536
2 changed files with 6 additions and 4 deletions

View file

@ -667,9 +667,10 @@ static void alsa_remove_device(struct impl *impl, struct device *device)
spa_hook_remove(&device->sync_listener);
if (device->reserve)
rd_device_destroy(device->reserve);
if (device->sdevice)
if (device->sdevice) {
spa_hook_remove(&device->listener);
sm_object_destroy(&device->sdevice->obj);
spa_hook_remove(&device->listener);
}
pw_unload_spa_handle(device->handle);
pw_properties_free(device->props);
free(device);