WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
29591
[Qt] QWebView takes ownership of QWebPage despite the documentation
https://bugs.webkit.org/show_bug.cgi?id=29591
Summary
[Qt] QWebView takes ownership of QWebPage despite the documentation
Tor Arne Vestbø
Reported
2009-09-21 08:57:49 PDT
This bug report originated from Nokia internal issue QT-1959 --- Comments --- Function: webkit Version: 4.5.1 Platform: Linux Linux NachBox 2.6.29-1-amd64 #1 SMP Fri Apr 17 10:12:36 UTC 2009 x86_64 GNU/Linux Debian Unstable, up to date Short description: QWebView takes ownership of QWebPage despite the documentation Did: Inside a class inherited from QMainWindow I created a QWebView, and assigned a page like so: webView->setPage(new QWebPage(this)); Expected to see: I expected everything to work normally. And exit cleanly. Got instead: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f3fd0dca750 (LWP 10415)] 0x00007f3fd01f8c0b in QWebView::~QWebView () from ./libQtWebKit.so.4 Current language: auto; currently asm (gdb) bt More details: Th documentation has this to say about QWebView: void QWebView::setPage ( QWebPage * page ) Makes page the new web page of the web view. The parent QObject of the provided page remains the owner of the object. If the current document is a child of the web view, it will be deleted. ------------------------------ I think that is incorrect, because it seems that the object was already deleted by my QMainWindow and then attempt to be deleted again by QWebView, and QWebView according to the above does not take ownership of the QWebPage, so it shouldn't try to delete it. When I changed my code to webView->setPage(new QWebPage); everything worked smoothly, and I did not receive a segmentation fault on exit.
Attachments
Add attachment
proposed patch, testcase, etc.
Simon Hausmann
Comment 1
2009-11-24 07:21:29 PST
Hmm, this shouldn't really happen as QWebView connects to the page's destroyed signal. We should close this issue if we have a unit-test for this.
Kent Hansen
Comment 2
2010-03-11 08:44:55 PST
Not able to reproduce, closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug