Fix crash when deleting Plugin after MIDI binding #8756

BindingProxy owns a PopUp prompter with 30 sec self-destruct
timeout. However ~BindingProxy explicitly destroys the PopUp.
Later the timeout can lead to a double-free.

This fixes a crash when deleting a plugin within 30 sec
after using MIDI learn.
This commit is contained in:
Robin Gareus 2021-06-23 04:02:07 +02:00
parent da8e4da34f
commit 8ad1405cf5
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,9 @@ PopUp::PopUp (Gtk::WindowPosition pos, unsigned int showfor_msecs, bool doh)
PopUp::~PopUp ()
{
if (popdown_time != 0 && timeout != -1) {
g_source_remove (timeout);
}
}
void
@ -76,6 +79,7 @@ PopUp::remove ()
if (popdown_time != 0 && timeout != -1) {
g_source_remove (timeout);
timeout = -1;
}
if (delete_on_hide) {
@ -137,6 +141,7 @@ PopUp::on_delete_event (GdkEventAny* /*ev*/)
if (popdown_time != 0 && timeout != -1) {
g_source_remove (timeout);
timeout = -1;
}
if (delete_on_hide) {