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:
parent
173700f0d7
commit
81796bc0b3
@ -5377,13 +5377,19 @@ BPoseView::MoveSelectionOrEntryToTrash(const entry_ref *ref, bool selectNext)
|
||||
std::map<int32, bool> deviceHasTrash;
|
||||
|
||||
if (ref) {
|
||||
if (!CheckVolumeReadOnly(ref))
|
||||
if (!CheckVolumeReadOnly(ref)) {
|
||||
delete entriesToTrash;
|
||||
delete entriesToDeleteOnTheSpot;
|
||||
return;
|
||||
}
|
||||
CopyOneTrashedRefAsEntry(ref, entriesToTrash, entriesToDeleteOnTheSpot,
|
||||
&deviceHasTrash);
|
||||
} else {
|
||||
if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef()))
|
||||
if (!CheckVolumeReadOnly(fSelectionList->ItemAt(0)->TargetModel()->EntryRef())) {
|
||||
delete entriesToTrash;
|
||||
delete entriesToDeleteOnTheSpot;
|
||||
return;
|
||||
}
|
||||
EachListItem(fSelectionList, CopyPoseOneAsEntry, entriesToTrash,
|
||||
entriesToDeleteOnTheSpot, &deviceHasTrash);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user