<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/101027/">http://git.reviewboard.kde.org/r/101027/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On April 5th, 2011, 3:20 p.m., <b>Andrea Diamantini</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Josè, 
many thanks for your patch and for the interesting Qt-BUG pointed out! I&#39;ll ask my Qt-devs around and try to merge your patch in a while. Anyway, I&#39;d like to understand why this bug occurs just in a few systems. Any ideas about?</pre>
 </blockquote>







</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; I&#39;d like to understand why this bug occurs just in a few systems. Any ideas about?

Yes. C&amp;P from http://doc.trolltech.com/4.7/objecttrees.html#construction-destruction-order-of-qobjects

&gt; When QObjects are created on the heap (i.e., created with new), a tree can be constructed from them in any order, and later, the objects in the tree can be destroyed in any order.

My conjecture is: 

The problem is that in my system some QWidget is deleted after the QApplication, triggering the Qt bug/feature #16974. However, since the objects in the tree can be destroyed in any order, I think it&#39;s reasonable to guess that in different systems the the deletion order may be different, thus you may or may not get the crash. Hence why I am deleting various objects in Application::~Application and not just the BookmarkProvider instance; I hope this would save you from headaches now and/or in the future, because (with a bit of bad luck) this may happen:

1. You add a QWidget to the object tree of ... let&#39;s say m_sessionManager (if you aren&#39;t doing it already).
2. The program works perfectly for you.
3. Some of your users get the crash and you can&#39;t reproduce it.

Just in case you want a system where you could reproduce the crash: I reproduced the bug in Debian sid with this semi-official repo http://qt-kde.debian.net/
I could reproduce under the circumstances explained here https://bugs.kde.org/show_bug.cgi?id=269490#c3 both in a virtualbox machine used to test our debian packages and in my main desktop.</pre>
<br />








<p>- José Manuel</p>


<br />
<p>On April 5th, 2011, 1:26 a.m., José Manuel  Santamaría Lema wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for rekonq.</div>
<div>By José Manuel  Santamaría Lema.</div>


<p style="color: grey;"><i>Updated April 5, 2011, 1:26 a.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hi,

I&#39;m not 100% sure but I tend to think you must not set a QApplication as the parent of a BookmarkProvider.

I think the problem is that any BookmarkProvider has QWidgets in its tree of QObjects. Therefore, you will get problems when deleting the children because of this:
http://bugreports.qt.nokia.com/browse/QTBUG-16974

So I just deleted some objects in Application::~Application in order to make sure these objects are deleted before the QApplication. Just deleting the BookmarkProvider in Application::~Application would be enough to fix the crash here, but I&#39;m deleting the other objects ...
1 ... because if now or in the future these objects had a QWidget in its object tree I think you might get a crash.
2 ... just in case.

By the way, I think the bug mentioned in this request was introduced in this commit 2b4efa406780920631af1166e79d54e54092322a

I have push permissions, if you give me the ok I will push this patch to 0.7-branch.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I have built rekonq with the patch; problem solved for me.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="/show_bug.cgi?id=269490">269490</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/application.cpp <span style="color: grey">(7fcbfe8)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/101027/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>