[Webkit-unassigned] [Bug 29591] New: [Qt] QWebView takes ownership of QWebPage despite the documentation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 21 08:57:49 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29591

           Summary: [Qt] QWebView takes ownership of QWebPage despite the
                    documentation
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Keywords: Qt
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: vestbo at webkit.org


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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list