<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/107572/">http://git.reviewboard.kde.org/r/107572/</a>
     </td>
    </tr>
   </table>
   <br />


<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 Nepomuk, Vishesh Handa and Sebastian Trueg.</div>
<div>By Simeon Bird.</div>







<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;">Slightly hacky fix for bug 292996 (crash in Nepomuk2::~Resource).

The problem is that kontact has a class, NepomukResourceRetrieverRunnable,
which inherits from QRunnable, and creates a Resource on the stack of it's QThread.

But, unknown to it, it is actually getting a reference to a Resource
stored by the ResourceManager, which has QApplication as a parent.

When kontact exists, it deletes ResourceManager.

But at this point the QRunnable has not yet been stopped,
because the caller assumes that they have allocated
Nepomuk::Resource on the QThread stack, and are not aware
that it is secretly shared with the other threads via
the singleton class in ResourceManager.

The QRunnable persists, but now resources don't point to anything.

The Q_ASSERTs in the destructor were not firing, I think, because only in a
release build was the destruction of QApplication fast enough to outrun
the QRunnables.

The fix is just to have the ResourceManager destructor check the
ref-count for all its resources in a loop and not go away until
they are all zero.

BUG: 292996
FIXED-IN: 4.10</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;">Compiled. Can't reproduce bug, so can't check it fixes it.</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="http://bugs.kde.org/show_bug.cgi?id=292996">292996</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>libnepomukcore/resource/resourcemanager.cpp <span style="color: grey">(457c042cef160660a6d2eb9b6695863bd75fdb86)</span></li>

</ul>

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




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




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