Project

General

Profile

Actions

Bug #1581

open

WResource::handleRequest: pure virtual method called

Added by Boris Nagaev over 11 years ago. Updated over 11 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?

Actions #1

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

Actions #2

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.

Actions #3

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

Actions

Also available in: Atom PDF