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:
parent
da8e4da34f
commit
8ad1405cf5
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user