[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    NULL _vptr
From:       Craig Howard <craig () choward ! ca>
Date:       2005-08-05 16:18:46
Message-ID: 200508051218.47473.craig () choward ! ca
[Download RAW message or body]

I'm working on a KPart and I've got essentially the following:

class PublicFactory : public KParts::Factory {
	public :
		KParts::Part *createPartObject( QWidget *parentWidget, const char 
*widgetName, QObject *parent, const char *name, const char *classname, const 
QStringList &args ) {
			return RealFactory::self()->createPartObject( parentWidget, widgetName, 
parent, name, classname, args );
		}
};

/* both are static members of RealFactory */
RealFactory *RealFactory::s_self = 0;
RealFactory *RealFactory::self()
{
	if ( !s_self ) {
		s_self = new RealFactory();
	}

	return s_self;
}

But when PublicFactory::createPartObject() gets executed, ::self returns a 
non-NULL pointer, but the _vptr of ::s_self is NULL!  This causes a segfault.  
s_self is not be deleted anywhere else, this was the first thing that I 
looked for.

Under what circumstances would _vptr be NULL?

Thanks.
-- 

Craig Howard
craig@choward.ca
Bachelor of Math - Computer Science 2005
University of Waterloo
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic