Skip to content

Commit

Permalink
animate: lock views while cleaning up (#2142)
Browse files Browse the repository at this point in the history
Ensures that we don't accidentally crash when cleaning up views.

Fixes #2005
  • Loading branch information
ammen99 committed Mar 13, 2024
1 parent 25eab09 commit 38532b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/animate/animate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ struct animation_hook : public animation_hook_base

static void cleanup_views_on_output(wf::output_t *output)
{
std::vector<std::shared_ptr<wf::view_interface_t>> all_views;
for (auto& view : wf::get_core().get_all_views())
{
all_views.push_back(view->shared_from_this());
}

for (auto& view : all_views)
{
auto wo = view->get_output();
if ((wo != output) && output)
Expand Down

0 comments on commit 38532b4

Please sign in to comment.