call RemoveSelf() on the replicant before deleting them. Fixes bug #1405
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21996 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1067,16 +1067,17 @@ BShelf::_DeleteReplicant(replicant_data* item)
|
|||||||
|
|
||||||
int32 index = replicant_data::IndexOf(&fReplicants, item->message);
|
int32 index = replicant_data::IndexOf(&fReplicants, item->message);
|
||||||
|
|
||||||
// TODO: Test if it's ok here
|
|
||||||
ReplicantDeleted(index, item->message, view);
|
ReplicantDeleted(index, item->message, view);
|
||||||
|
|
||||||
fReplicants.RemoveItem(item);
|
fReplicants.RemoveItem(item);
|
||||||
|
|
||||||
if (loadedImage && item->image >= 0)
|
if (loadedImage && item->image >= 0)
|
||||||
unload_add_on(item->image);
|
unload_add_on(item->image);
|
||||||
|
|
||||||
delete item;
|
delete item;
|
||||||
|
|
||||||
|
// TODO: Should we also delete the view ?
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1195,11 +1196,15 @@ BShelf::_AddReplicant(BMessage *data, BPoint *location, uint32 uniqueID)
|
|||||||
// the view has not been accepted
|
// the view has not been accepted
|
||||||
|
|
||||||
if (relation == BDragger::TARGET_IS_PARENT
|
if (relation == BDragger::TARGET_IS_PARENT
|
||||||
|| relation == BDragger::TARGET_IS_SIBLING)
|
|| relation == BDragger::TARGET_IS_SIBLING) {
|
||||||
delete replicant;
|
replicant->RemoveSelf();
|
||||||
|
delete replicant;
|
||||||
|
}
|
||||||
if (relation == BDragger::TARGET_IS_CHILD
|
if (relation == BDragger::TARGET_IS_CHILD
|
||||||
|| relation == BDragger::TARGET_IS_SIBLING)
|
|| relation == BDragger::TARGET_IS_SIBLING) {
|
||||||
|
dragger->RemoveSelf();
|
||||||
delete dragger;
|
delete dragger;
|
||||||
|
}
|
||||||
|
|
||||||
return send_reply(data, B_ERROR, uniqueID);
|
return send_reply(data, B_ERROR, uniqueID);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user