BShelf: Unset the shelf of the containing view on destruction.

The BShelf sets itself as a handler on the containing view on creation
but didn't unset itself on destruction. When the containing view was
later destroyed it would unset the shelf which triggered a
use-after-free if you deleted the BShelf beforehand.

Since the ownership of a BShelf isn't explicitly documented I took the
shelf in DeskWindow of Tracker as a reference, which does delete it
explicitly.
This commit is contained in:
Michael Lotz 2015-04-04 10:40:57 +02:00
parent 23a1bcf28b
commit 46578389ba

View File

@ -560,6 +560,8 @@ BShelf::~BShelf()
fReplicants.RemoveItem((int32)0);
delete data;
}
fContainerView->_SetShelf(NULL);
}