From 0cb1b20a1f63d85b2e6ebee995fdaf26d1fd5eee Mon Sep 17 00:00:00 2001 From: PawanYr Date: Sun, 4 May 2025 00:02:35 -0400 Subject: [PATCH] Haiku Depot: Fix text document ref crash In +9146, I added a 'Search all packages' helper message to the Haiku Depot featured packages view using a TextDocumentView; seems I used the TextDocumentRef incorrectly, causing a crash on exit; this fixes that. Change-Id: Idc08fb58dee13b6e85663097876a80a190941f57 Reviewed-on: https://review.haiku-os.org/c/haiku/+/9242 Reviewed-by: Andrew Lindesay --- src/apps/haikudepot/ui/FeaturedPackagesView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp index d7c7a8ebeb..68a8131130 100644 --- a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp +++ b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp @@ -1109,7 +1109,7 @@ void FeaturedPackagesView::_BuildNoResultsView() { fNoResultsView = new TextDocumentView(); - TextDocumentRef noResultsTextDocument = new TextDocument(); + TextDocumentRef noResultsTextDocument(new(std::nothrow) TextDocument(), true); ParagraphStyle paragraphStyle; paragraphStyle.SetAlignment(ALIGN_CENTER); Paragraph paragraph(paragraphStyle);