From d556224730e06d45b89813a7e5f177a59e786d70 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 18 Feb 2022 18:39:32 -0500 Subject: [PATCH] HaikuDepot: Cleanup and release references early. So that we do not destroy things in the wrong order and trigger the reference-counting assertions. Fixes #17579. --- src/apps/haikudepot/ui/MainWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apps/haikudepot/ui/MainWindow.cpp b/src/apps/haikudepot/ui/MainWindow.cpp index 20bbad945b..68a0c4547a 100644 --- a/src/apps/haikudepot/ui/MainWindow.cpp +++ b/src/apps/haikudepot/ui/MainWindow.cpp @@ -292,6 +292,13 @@ MainWindow::~MainWindow() if (fShuttingDownWindow->Lock()) fShuttingDownWindow->Quit(); } + + // We must clear and delete these early to release references. + fModel.Clear(); + fFeaturedPackagesView->RemoveSelf(); + fPackageListView->RemoveSelf(); + delete fFeaturedPackagesView; + delete fPackageListView; }