From 93bf6e6901744f4bee2b673361ae81a97d3dd340 Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Wed, 13 Feb 2019 11:30:53 +0100 Subject: alsa-transaction: simplify the cleanup This simplifies the invocation of cleanup, by only using AlsaMixerTransactionDelete that performs the 3 actions of cleanup, removal from list, and memory freeing. Fixes a bug at MixerExit, because the first transaction was not removed from the list and led to a double free error. Also added a boolean parameter to AlsaMixerTransactionObjectDelete (was AlsaMixerTransactionObjectForget before), that decides wether or not the found object must be destroyed with its destructor (for most of the cases) or simply freed in memory (which is needed for loop device). Change-Id: I2eacbf80a22e3d556dc432d393a1807fcd7c47fb Signed-off-by: Thierry Bultel --- plugins/alsa/alsa-api-loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/alsa/alsa-api-loop.c') diff --git a/plugins/alsa/alsa-api-loop.c b/plugins/alsa/alsa-api-loop.c index 7e852a8..bc3c62a 100644 --- a/plugins/alsa/alsa-api-loop.c +++ b/plugins/alsa/alsa-api-loop.c @@ -117,7 +117,7 @@ STATIC int CheckOneSubdev(SoftMixerT *mixer, AlsaSndLoopT *loop, AlsaLoopSubdevT pcmCtl->closeAtDeletion = true; // free PCM as we only open loop to assert it's a valid capture device - AlsaMixerTransactionObjectForget(mixer->transaction, pcmCtl); + AlsaMixerTransactionObjectDelete(mixer->transaction, pcmCtl, false); AlsaPcmCtlDelete(mixer, pcmCtl); return 0; -- cgit 1.2.3-korg