Hi
i am reading sfml game development book and i am wondering about why there is no virtual destructor in the codes ? for example scene node is a base class that contain some virtual functions , then aircraft is an entity where entity is itself a scene node . we assign an aircraft to one the scene nodes as unique_ptr<sceneNode>.
so here delete is performed on the scene node ! now we don't have any virtual destructor in the scene node . also there is none in the entity class .
so only the default destructor of the scene node is called , and derived classes resources will leak .
i have read that there must be a virtual destructor , if and only if , there is a virtual function exists in the base class code .and in our case there is virtual function
that is what i think , any way if i am wrong please guide me .
thanks .