Skip to content

Commit 7627d5f

Browse files
soreautrigg
authored andcommitted
window-list: Destroy handles and globals from ext binds
This effectively fixes a crash on window-list widget unload.
1 parent 2f46a08 commit 7627d5f

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

src/panel/widgets/window-list/window-list.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,32 @@ WayfireWindowList::~WayfireWindowList()
471471
* when the window-list widget is unloaded. */
472472
toplevels.clear();
473473

474-
zwlr_foreign_toplevel_manager_v1_destroy(this->manager);
474+
for (auto & list_toplevel : list_toplevels)
475+
{
476+
ext_foreign_toplevel_handle_v1_destroy(list_toplevel.first);
477+
}
478+
479+
list_toplevels.clear();
480+
481+
if (this->manager)
482+
{
483+
zwlr_foreign_toplevel_manager_v1_destroy(this->manager);
484+
}
485+
486+
if (this->foreign_toplevel_list)
487+
{
488+
ext_foreign_toplevel_list_v1_destroy(this->foreign_toplevel_list);
489+
}
490+
491+
if (this->copy_capture_manager)
492+
{
493+
ext_image_copy_capture_manager_v1_destroy(this->copy_capture_manager);
494+
}
495+
496+
if (this->toplevel_capture_manager)
497+
{
498+
ext_foreign_toplevel_image_capture_source_manager_v1_destroy(this->toplevel_capture_manager);
499+
}
475500

476501
if (this->dmabuf)
477502
{

0 commit comments

Comments
 (0)