Project

General

Profile

Bug #1581

WResource::handleRequest: pure virtual method called

Added by Boris Nagaev about 10 years ago. Updated almost 10 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
11/28/2012
Due date:
% Done:

0%

Estimated time:

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?

#1

Updated by Koen Deforche almost 10 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

#2

Updated by Boris Nagaev almost 10 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.

#3

Updated by Koen Deforche almost 10 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

Also available in: Atom PDF