Bug 95775 - SOLVED
Andras Mantia
amantia at kde.org
Tue Jan 4 12:20:26 GMT 2005
Andras Mantia wrote:
> Hi,
>
> I got a crash report for Quanta (which is reproduceable with CVS HEAD)
> that indicates that the crash is in KHTML, although the only way to
> reproduce the crash is inside Quanta.
OK, problem found (was in Quanta) and solved based on a hint of gdb, telling
me that some symbols cannot be accessed through the virtual table (or
something like that) and that clear() was called from the ~WHTMLPart as
well. Until now we had:
class WHTMLPart : public KHTMLPart {
Q_OBJECT
public:
WHTMLPart(QWidget *parent, const char *name=0);
[...]
virtual KParts::ReadOnlyPart *createPart( QWidget *parentWidget, const
char *widgetName,QObject *parent, const char *name,const QString &mimetype,
QString &serviceName,QStringList &serviceTypes, const QStringList ¶ms);
[...]
}
and
WHTMLPart::WHTMLPart(QWidget *parent, const char *name )
: KHTMLPart(parent,name)
{
...
}
KParts::ReadOnlyPart *WHTMLPart::createPart( QWidget * parentWidget, const
char *widgetName,QObject */*parent*/, const char * /*name*/,const QString
&, QString &,QStringList &, const QStringList &)
{
return new WHTMLPart(parentWidget, widgetName);
}
while KHTMLPart has two constructors, but with different signature:
KHTMLPart( QWidget *parentWidget = 0, const char *widgetname = 0,
QObject *parent = 0, const char *name = 0, GUIProfile prof =
DefaultGUI );
KHTMLPart( KHTMLView *view, QObject *parent = 0, const char *name = 0,
GUIProfile prof = DefaultGUI );
By changing WHTMLPart's constructor to look like:
WHTMLPart::WHTMLPart(QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name, GUIProfile prof)
: KHTMLPart(parentWidget, widgetName, parent, name, prof)
[...]
and WHTMLPart::createPart to
{
return new WHTMLPart(parentWidget, widgetName, parent, name);
}
the crash disappeared.
I'm not completely sure about the real reason of the crash, but I suspect
some wrong virtual table building when a new part was created in
WHTMLPart::createPart due to the different constructor.
But as I sat this crash wasn't there before, so in the end something has
changed in KHTML as well.
Andras
--
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
More information about the kfm-devel
mailing list