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.
This commit is contained in:
Augustin Cavalier 2022-02-18 18:39:32 -05:00
parent 1e7094566a
commit d556224730

View File

@ -292,6 +292,13 @@ MainWindow::~MainWindow()
if (fShuttingDownWindow->Lock()) if (fShuttingDownWindow->Lock())
fShuttingDownWindow->Quit(); fShuttingDownWindow->Quit();
} }
// We must clear and delete these early to release references.
fModel.Clear();
fFeaturedPackagesView->RemoveSelf();
fPackageListView->RemoveSelf();
delete fFeaturedPackagesView;
delete fPackageListView;
} }