Bug 48323 - [Qt] Assert in the tst_hybridPixmap::hybridPixmap() unit test.
Summary: [Qt] Assert in the tst_hybridPixmap::hybridPixmap() unit test.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-10-26 07:08 PDT by Jocelyn Turcotte
Modified: 2010-10-26 13:04 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.50 KB, patch)
2010-10-26 07:13 PDT, Jocelyn Turcotte
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jocelyn Turcotte 2010-10-26 07:08:56 PDT
ASSERTION FAILED: !m_adoptionIsRequired
(../../../JavaScriptCore/wtf/RefCounted.h:37 void WTF::RefCountedBase::ref())
Comment 1 Jocelyn Turcotte 2010-10-26 07:13:59 PDT
Created attachment 71877 [details]
Patch
Comment 2 Andreas Kling 2010-10-26 07:31:06 PDT
Comment on attachment 71877 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=71877&action=review

> WebCore/bridge/qt/qt_pixmapruntime.cpp:358
> -    QtPixmapInstance* instance = new QtPixmapInstance(root, data);
> +    RefPtr<QtPixmapInstance> instance = adoptRef(new QtPixmapInstance(root, data));

What happens with the QtPixmapInstance after this function returns?
I'm asking because it was leaked previously, and createRuntimeObject() returns a member of the instance.
Comment 3 Kenneth Rohde Christiansen 2010-10-26 07:50:09 PDT
(In reply to comment #2)
> (From update of attachment 71877 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=71877&action=review
> 
> > WebCore/bridge/qt/qt_pixmapruntime.cpp:358
> > -    QtPixmapInstance* instance = new QtPixmapInstance(root, data);
> > +    RefPtr<QtPixmapInstance> instance = adoptRef(new QtPixmapInstance(root, data));
> 
> What happens with the QtPixmapInstance after this function returns?
> I'm asking because it was leaked previously, and createRuntimeObject() returns a member of the instance.

You are right, it will be dereffed on return. It depends on what createRuntimeObject is doing.
Comment 4 Kenneth Rohde Christiansen 2010-10-26 09:06:30 PDT
> > WebCore/bridge/qt/qt_pixmapruntime.cpp:358
> > -    QtPixmapInstance* instance = new QtPixmapInstance(root, data);
> > +    RefPtr<QtPixmapInstance> instance = adoptRef(new QtPixmapInstance(root, data));
> 
> What happens with the QtPixmapInstance after this function returns?
> I'm asking because it was leaked previously, and createRuntimeObject() returns a member of the instance.

That member which is being returned is created by newRuntimeObject, but not owner by the Instance.
Comment 5 WebKit Commit Bot 2010-10-26 12:47:58 PDT
Comment on attachment 71877 [details]
Patch

Clearing flags on attachment: 71877

Committed r70557: <http://trac.webkit.org/changeset/70557>
Comment 6 WebKit Commit Bot 2010-10-26 12:48:04 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Ademar Reis 2010-10-26 13:03:59 PDT
Revision r70557 cherry-picked into qtwebkit-2.1 with commit 12362e4 <http://gitorious.org/webkit/qtwebkit/commit/12362e4>