[Haiku-commits] r31013 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam

Michael Lotz mmlr at mlotz.ch
Fri Jun 12 18:25:39 CEST 2009

> mmlr at mail.berlios.de schrieb:
> > Need to stop the roster before deleting it. Should fix bug #4017.
> If this is something that any client of BUSBRoster has to do before 
> deleting a roster instance, this may as well be called in the roster 
> destructor itself, no? Or is Stop() a virtual method and BUSBRoster 
> can 
> be subclassed?

In principle yes, and it does, but it cannot work. When the BUSBRoster 
destructor is called, it is called with "this" being the BUSBRoster 
base class only, and not the subclassed roster anymore. At this point 
the pure virtual functions that were provided by the subclass aren't 
available anymore, hence the pure virtual function call in the first 
place. It basically means that you need to call Stop() while the object 
is still intact and the subclass vtable is in place. Another way of 
"solving" it would be to check if the function call is still available 
and then just not call it if not, but I don't know off hand how to do 


More information about the Haiku-commits mailing list