Don't leak memory when aborting operations due to read-only volume.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5377,13 +5377,19 @@ BPoseView::MoveSelectionOrEntryToTrash(const entry_ref *ref, bool selectNext)
|
|||||||
std::map<int32, bool> deviceHasTrash;
|
std::map<int32, bool> deviceHasTrash;
|
||||||
|
|
||||||
if (ref) {
|
if (ref) {
|
||||||
if (!CheckVolumeReadOnly(ref))
|
if (!CheckVolumeReadOnly(ref)) {
|
||||||
|
delete entriesToTrash;
|
||||||
|
delete entriesToDeleteOnTheSpot;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
CopyOneTrashedRefAsEntry(ref, entriesToTrash, entriesToDeleteOnTheSpot,
|
CopyOneTrashedRefAsEntry(ref, entriesToTrash, entriesToDeleteOnTheSpot,
|
||||||
&deviceHasTrash);
|
&deviceHasTrash);
|
||||||
} else {
|
} else {
|
||||||
if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef()))
|
if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef())) {
|
||||||
|
delete entriesToTrash;
|
||||||
|
delete entriesToDeleteOnTheSpot;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
EachListItem(fSelectionList, CopyPoseOneAsEntry, entriesToTrash,
|
EachListItem(fSelectionList, CopyPoseOneAsEntry, entriesToTrash,
|
||||||
entriesToDeleteOnTheSpot, &deviceHasTrash);
|
entriesToDeleteOnTheSpot, &deviceHasTrash);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user