diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-30 16:30:00 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-30 16:30:00 +0200 |
commit | 821d771e86dcfc64491b2619f799ac977fc32630 (patch) | |
tree | 0a07fea834bbef934f6171db4c350bb8f3242c23 /src/sound.c | |
parent | 8d71b54409ca6cf989dfb7d7fe265768fb7fe062 (diff) | |
download | vim-git-821d771e86dcfc64491b2619f799ac977fc32630.tar.gz |
patch 8.1.1944: leaking memory when using sound callbackv8.1.1944
Problem: Leaking memory when using sound callback.
Solution: src/sound.c
Diffstat (limited to 'src/sound.c')
-rw-r--r-- | src/sound.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sound.c b/src/sound.c index 69bbc5e6d..11170afb7 100644 --- a/src/sound.c +++ b/src/sound.c @@ -171,6 +171,7 @@ invoke_sound_callback(void) clear_tv(&rettv); delete_sound_callback(scb->scb_callback); + vim_free(scb); } redraw_after_callback(TRUE); } @@ -263,10 +264,21 @@ f_sound_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED) void sound_free(void) { + soundcb_queue_T *scb; + if (context != NULL) ca_context_destroy(context); + while (first_callback != NULL) delete_sound_callback(first_callback); + + while (callback_queue != NULL) + { + scb = callback_queue; + callback_queue = scb->scb_next; + delete_sound_callback(scb->scb_callback); + vim_free(scb); + } } # endif |