Skip to content

Commit

Permalink
Merge pull request #3030 from MirServer/fix-2011
Browse files Browse the repository at this point in the history
Fix locking in mgw::DisplayClient()
  • Loading branch information
AlanGriffiths authored Sep 1, 2023
2 parents b835713 + 881a81a commit 7d67a33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/platforms/wayland/displayclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,13 @@ void mgw::DisplayClient::remove_global(
{
DisplayClient* self = static_cast<decltype(self)>(data);

std::lock_guard lock{self->outputs_mutex};
std::unique_lock lock{self->outputs_mutex};
auto const output = self->bound_outputs.find(id);
if (output != self->bound_outputs.end())
{
self->outputs_to_be_deleted.push_back(std::move(output->second));
self->bound_outputs.erase(output);
lock.unlock();
self->on_display_config_changed();
}
// TODO: We should probably also delete any other globals we've bound to that disappear.
Expand Down

0 comments on commit 7d67a33

Please sign in to comment.