diff options
author | Thierry Bultel <thierry.bultel@iot.bzh> | 2019-02-13 11:30:53 +0100 |
---|---|---|
committer | Thierry Bultel <thierry.bultel@iot.bzh> | 2019-02-18 15:51:30 +0100 |
commit | edeccfc0d062117bdb74c86044e197372ca25885 (patch) | |
tree | 188927e042902e0907d128aed5902a4b84ec0b39 /plugins/alsa/alsa-transaction.h | |
parent | 0e9718e4158355093b281c1376ba9b0ed049d447 (diff) |
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 <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins/alsa/alsa-transaction.h')
-rw-r--r-- | plugins/alsa/alsa-transaction.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugins/alsa/alsa-transaction.h b/plugins/alsa/alsa-transaction.h index 7726458..6bb5d92 100644 --- a/plugins/alsa/alsa-transaction.h +++ b/plugins/alsa/alsa-transaction.h @@ -31,9 +31,7 @@ extern void AlsaMixerTransactionDataListDestroy(AlsaMixerTransaction*); extern bool AlsaMixerTransactionObjectAdd(AlsaMixerTransaction*, void * object, AlsaTransactionDestructor destructor); -extern void AlsaMixerTransactionObjectForget(AlsaMixerTransaction* list, void * object); - -extern void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction*); +extern void AlsaMixerTransactionObjectDelete(AlsaMixerTransaction* list, void * object, bool destructor); extern bool AlsaMixerTransactionVerbCreate(AlsaMixerTransaction*); |