I'm not sure about the idea behind this function but it looks at first glance like it might leak memory, i.e. _bheItems can contain objects allocated via new. On the other hand it seems BehaviorManager::clear conatins some logic for deleting these. That looks like an odd place to do this in OOP. But this is simply a style issue and maybe only confused me in specifiy when looking over this ;-).