Hi,

The attached example crashed QtWebKit.
Seems that calling setHtml() in a slot connected to unsupportedContent() leads 
to a crash

Any ideas what might be going wrong ?

Qt 4.4 beta, Debian testing, g++ 4.2.3

Here's how I compiled the attached file:

export PKG_CONFIG_PATH=/home/mohammed/qt4/lib/pkgconfig/
export PATH=/home/mohammed/qt4/bin/:$PATH
moc webkit_crash.cc > webkit_crash.cpp
g++ -o webkit webkit_crash.cc `pkg-config QtWebKit QtCore QtGui --cflags 
--libs` -Wl,-rpath /home/mohammed/qt4/lib/
./webkit

clicking "Crash me :(" leads to a crash.

Cheers,

-- 
GPG-Key: 0xA3FD0DF7 - 9F73 032E EAC9 F7AD 951F  280E CB66 8E29 A3FD 0DF7
Debian User and Developer.
Homepage: www.foolab.org
#include <qobject.h>
#include <qapplication.h>
#include <qwebview.h>
#include <qmainwindow.h>
#include <qwebpage.h>

class WebView : public QWebView {
  Q_OBJECT
public:
  WebView() {
    setHtml(QString("<a href=\"file:///home\">Crash me :(</a>"));
    page()->setForwardUnsupportedContent(true);
    QObject::connect(page(), SIGNAL(unsupportedContent(QNetworkReply *)), SLOT(handleUnsupportedContent(QNetworkReply *)));
  }

public slots:
  void handleUnsupportedContent(QNetworkReply *reply) {
  setHtml(QString("Bye!"));
    }
};

int main(int argc, char *argv[]) {
  QApplication a(argc, argv);
  WebView v;

  v.show();

  return a.exec();
}

#include "webkit_crash.cpp"

Attachment: signature.asc
Description: Digital signature

Reply via email to