From 8df5e79d2c734f683be421eb997d72d1d205fc23 Mon Sep 17 00:00:00 2001 From: Philippe Saint-Pierre Date: Thu, 5 Jan 2012 17:52:21 -0500 Subject: [PATCH] Tracker: FSMoveToTrash(): needless check and possible crash fix In an earlier commit, I removed a memleak, but it was covering more cases than intended. Thanks to Alex Wilson's insight, it seems that simply removing the check is better (since that check is essentially redone in FSMoveToTrash()). --- src/kits/tracker/Tracker.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/kits/tracker/Tracker.cpp b/src/kits/tracker/Tracker.cpp index c5d96ee321..5fe7f0ba23 100644 --- a/src/kits/tracker/Tracker.cpp +++ b/src/kits/tracker/Tracker.cpp @@ -600,10 +600,8 @@ TTracker::MoveRefsToTrash(const BMessage *message) srcList->AddItem(new entry_ref(ref)); } - if (srcList->CountItems()) - // async move to trash - FSMoveToTrash(srcList); - delete srcList; + // async move to trash + FSMoveToTrash(srcList); }