Bug #1581
openWResource::handleRequest: pure virtual method called
0%
Description
Hello!
Class A is inherited from WResource. beingDeleted() is called from A's destructor.
Class B is inherited from class A. Class B does not have destructor or handleRequest.
I have instances of class B in my application.
I got crash with message "pure virtual method called" because of WResource::handleRequest. How can this be?
Updated by Koen Deforche over 11 years ago
- Status changed from New to Feedback
Hey,
I guess you still need to implement B's destructor to call beingDeleted(). Have you tried that and did it not solve the problem ?
Regards,
koen
Updated by Boris Nagaev over 11 years ago
Hello!
I have not tried to implement B's destructor to call beingDeleted(). Why is it needed? beingDeleted() is called by A's destructor before vpointer will be set to WResource's vtable. Is it possible to exclude calls to beingDeleted() from derived classes?
I can't reproduce this as test case, because it is very rare.
Updated by Koen Deforche over 11 years ago
I have not tried to implement B's destructor to call beingDeleted(). Why is it needed? beingDeleted() is called by A's destructor before vpointer will be set to WResource's vtable. Is it possible to exclude calls to beingDeleted() from derived classes?
I'm not entirely sure that this is what happens: is it not simply undefined behavior of calling a virtual method during destruction: I'm not sure that the vtable pointer is being reset to the parent's type as destruction moves from one class to its parent.
Regards,
koen