PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1138 - Subclassing of QUiLoader leads to "Internal C++ object already deleted" exception (again)
: Subclassing of QUiLoader leads to "Internal C++ object already deleted" excep...
Status: RESOLVED FIXED
Product: PySide
Classification: Unclassified
Component: QtUiTools
: HEAD
: PC MS Windows XP/Vista/7
: P3 normal
Assigned To: Paulo Alcantara
:
:
:
  Show dependency treegraph
 
Reported: 2012-02-09 12:36 EET by Vladimir Rutsky
Modified: 2012-02-26 02:31 EET (History)
10 users (show)

See Also:


Attachments
Example that reproduced bug. (636 bytes, text/plain)
2012-02-09 12:36 EET, Vladimir Rutsky
Details
UI file for reproducing bug example (QDockWidget with vertical layout). (1.12 KB, application/x-designer)
2012-02-09 12:37 EET, Vladimir Rutsky
Details
Patch for this issue (don't include fixes for createAction() etc) (539 bytes, patch)
2012-02-09 13:50 EET, Vladimir Rutsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Rutsky 2012-02-09 12:36:42 EET
Created attachment 484 [details]
Example that reproduced bug.

This report is similar to bug #1060 [1]: after subclassing QUiLoader and
loading with it some UI, access to resulting widget leads to "Internal C++
object (...) already deleted" exception.

In example in bug #1060 I overrided QUiLoader.createWidget() method, now I'm
overriding QUiLoader.createLayout() which leads to same "Internal C++ object
(...) already deleted" exception.

To fix bug #1060 Paulo make following change: added 

  <define-ownership class="target" owner="default"/>

to createWidget() method description, but for other methods (createLayout(),
createAction(), createActionGroup()) "define-ownership" wasn't added, I this
this is source of the problem.


[1] http://bugs.pyside.org/show_bug.cgi?id=1060
Comment 1 Vladimir Rutsky 2012-02-09 12:37:51 EET
Created attachment 485 [details]
UI file for reproducing bug example (QDockWidget with vertical layout).
Comment 2 Vladimir Rutsky 2012-02-09 13:50:14 EET
Created attachment 486 [details]
Patch for this issue (don't include fixes for createAction() etc)

I tested adding "define-ownership" for QtUiLoader.createLayout() and can
confirm, that fixes my issue.

Also, as I mentioned before, I think same "define-ownership" should be
specified for some other methods in QtUiLoader.
Comment 3 Paulo Alcantara 2012-02-09 16:30:15 EET
(In reply to comment #2)
> Created attachment 486 [details]
> Patch for this issue (don't include fixes for createAction() etc)
> 
> I tested adding "define-ownership" for QtUiLoader.createLayout() and can
> confirm, that fixes my issue.
> 
> Also, as I mentioned before, I think same "define-ownership" should be
> specified for some other methods in QtUiLoader.
Comment 4 Paulo Alcantara 2012-02-09 16:50:00 EET
Hi Vladimir,

(In reply to comment #3)
> (In reply to comment #2)
> > Created attachment 486 [details]
> > Patch for this issue (don't include fixes for createAction() etc)
> > 
> > I tested adding "define-ownership" for QtUiLoader.createLayout() and can
> > confirm, that fixes my issue.
> > 
> > Also, as I mentioned before, I think same "define-ownership" should be
> > specified for some other methods in QtUiLoader.

Thanks for going deep with this issue. Looks like you're going to the right
way. In this weekend I'll test your fixes and then ping you about the results.
(I'm almost sure you did the right fix, however I need to ask buildbot to build
PySide against your patch and then check if that didn't break anything else)


           - Paulo Alcantara
Comment 5 Paulo Alcantara 2012-02-26 02:31:56 EET
Hi Vladimir,

Thanks for the report!

This bug has been fixed on PySide commit
797c7b26d1e9c2dc3f7ca9aa48b50c349b732a8b.


           - Paulo Alcantara