SubscriberInterface virtual destructor missing

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
nfz
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Wed Jan 12, 2005 12:06

SubscriberInterface virtual destructor missing

Postby nfz » Sun Oct 17, 2004 00:30

Usually I wait a few days after cvs gets updated before I post about errors in cvs. Decided to be different this time:).

The base class SubscriberInterface does not have a virtual destructor so when 'delete d_si' in the template class SubscriberTemplate is executed, it only calls the base class's destructor and not those of the subclasses which results in leaks and exceptions in debug mode with the Ogre memory manager.

I added a virtual destructor to the SubscriberInterface class:

Code: Select all

class CEGUIBASE_API SubscriberInterface
{
public:
    virtual bool operator()(const EventArgs& args) const = 0;
    virtual ~SubscriberInterface() {}
};


User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

SubscriberInterface virtual destructor missing

Postby CrazyEddie » Sun Oct 17, 2004 04:57

Thanks, I actually thought about virtual dtors for the new events stuff in bed an hour ago :D I'll get this sorted later today.

CE.


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests