From ead5f1bdfc48bf2f50b69ba3163350912a392efd Mon Sep 17 00:00:00 2001 From: Zardshard <0azrune6@zard.anonaddy.com> Date: Sat, 2 May 2026 18:08:29 -0400 Subject: [PATCH] Icon-O-Matic: Fix crash when unassigning path Fixes #19375 Change-Id: I624cd8ad78e8e429f0ca3b32df24fb46e7636620 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10884 Haiku-Format: Haiku-format Bot Reviewed-by: nephele nephele Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/apps/icon-o-matic/gui/PathListView.cpp | 2 +- src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/icon-o-matic/gui/PathListView.cpp b/src/apps/icon-o-matic/gui/PathListView.cpp index 58163b34d6..aefb1a61e7 100644 --- a/src/apps/icon-o-matic/gui/PathListView.cpp +++ b/src/apps/icon-o-matic/gui/PathListView.cpp @@ -897,7 +897,7 @@ PathListView::_UpdateMarks() { int32 count = CountItems(); if (fCurrentShape != NULL) { - // enable display of marks and mark items whoes + // enable display of marks and mark items whose // path is contained in fCurrentShape for (int32 i = 0; i < count; i++) { PathListItem* item = dynamic_cast(ItemAt(i)); diff --git a/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp b/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp index cd28b60a1b..4683a987a2 100644 --- a/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp +++ b/src/apps/icon-o-matic/shape/commands/UnassignPathCommand.cpp @@ -27,6 +27,7 @@ UnassignPathCommand::UnassignPathCommand(PathSourceShape* shape, fPath(path), fPathRemoved(false) { + fPath->AcquireReference(); } // destructor