...having thought about it: doesn't the problem stem from not holding SessionManager::mutex when these actions occur?
void msh::SessionManager::close_session(std::shared_ptr<mf::Session> const& session) { auto shell_session = std::dynamic_pointer_cast<Session>(session);
session_listener->stopping(shell_session);
app_container->remove_session(shell_session);
std::unique_lock<std::mutex> lock(mutex); set_focus_to_locked(lock, focus_sequence->default_focus()); }
Note that the SessionManager::mutex isn't seized until after the remove_session() call.
inline void msh::SessionManager::set_focus_to_locked(std::unique_lock<std::mutex> const&, std::shared_ptr<Session> const& shell_session) { auto old_focus = focus_application.lock();
focus_application = shell_session;
focus_setter->set_focus_to(shell_session); if (shell_session) { session_listener->focused(shell_session); } else { session_listener->unfocused(); } }
Note that the SessionManager::mutex isn't seized.
« Back to merge proposal
...having thought about it: doesn't the problem stem from not holding SessionManager: :mutex when these actions occur?
void msh::SessionMan ager::close_ session( std::shared_ ptr<mf: :Session> const& session) pointer_ cast<Session> (session) ;
{
auto shell_session = std::dynamic_
session_ listener- >stopping( shell_session) ;
app_ container- >remove_ session( shell_session) ;
std: :unique_ lock<std: :mutex> lock(mutex); focus_to_ locked( lock, focus_sequence- >default_ focus() );
set_
}
Note that the SessionManager: :mutex isn't seized until after the remove_session() call.
inline void msh::SessionMan ager::set_ focus_to_ locked( std::unique_ lock<std: :mutex> const&, std::shared_ ptr<Session> const& shell_session) on.lock( );
{
auto old_focus = focus_applicati
focus_ application = shell_session;
focus_ setter- >set_focus_ to(shell_ session) ;
session_ listener- >focused( shell_session) ;
session_ listener- >unfocused( );
if (shell_session)
{
}
else
{
}
}
Note that the SessionManager: :mutex isn't seized.