Attempted fix for `idle_drop_window` random crashes (1/2)

This commit is contained in:
Robin Gareus 2022-12-03 19:16:43 +01:00
parent 1736b1d424
commit 2bca6395cc
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 8 additions and 2 deletions

View File

@ -4700,7 +4700,7 @@ ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* b
default:
break;
}
Glib::signal_idle ().connect (sigc::bind (&idle_drop_window, self));
me->_drop_window_connection = Glib::signal_idle ().connect (sigc::bind (&idle_drop_window, self)/*, G_PRIORITY_HIGH_IDLE*/);
}, this, pi->type ()));
}
}
@ -4719,8 +4719,11 @@ ProcessorWindowProxy::processor_going_away ()
{
gui_connections.drop_connections ();
_unmap_connection.disconnect ();
delete _window;
_drop_window_connection.disconnect ();
Gtk::Window* w = _window;
/* Unset _window, any allbacks triggered by `delete _window`, will see _window = 0; */
_window = 0;
delete w;
WM::Manager::instance().remove (this);
/* should be no real reason to do this, since the object that would
send DropReferences is about to be deleted, but lets do it anyway.
@ -4777,6 +4780,7 @@ ProcessorWindowProxy::get (bool create)
/* drop existing window - wrong type */
set_state_mask (Gtkmm2ext::WindowProxy::StateMask (state_mask () & ~WindowProxy::Size));
_unmap_connection.block ();
_drop_window_connection.disconnect ();
drop_window ();
_unmap_connection.unblock ();
}
@ -4804,6 +4808,7 @@ ProcessorWindowProxy::show_the_right_window (bool show_not_toggle)
/* drop existing window - wrong type */
set_state_mask (Gtkmm2ext::WindowProxy::StateMask (state_mask () & ~WindowProxy::Size));
_unmap_connection.block ();
_drop_window_connection.disconnect ();
drop_window ();
_unmap_connection.unblock ();
}

View File

@ -113,6 +113,7 @@ private:
void processor_going_away ();
sigc::connection _unmap_connection;
sigc::connection _drop_window_connection;
PBD::ScopedConnection going_away_connection;
PBD::ScopedConnectionList gui_connections;
};