<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/107575/">http://git.reviewboard.kde.org/r/107575/</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, Sebastian Trueg and Simeon Bird.</div>
<div>By Vishesh Handa.</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;"> ResourceManager: Cleanup out all the existing Resources before exit
Ideally, there should be no ResourceData* in the cache when the
ResourceManager is being destroyed. However, they can be cases when a
Resource has been allocated statically and it is destroyed after the
ResourceManager. In that case, when the Resource is eventually
destroyed, it will crash as it will try to access the deleted
ResourceManager.
In order to fix this, we connect to QCoreApplication::aboutToQuit signal
and set all the Resource::m_data = 0. This results in the Resource class
not doing anything during its destruction and therefore not crashing. We
also delete all the ResourceData pointers.
This cleanUpResource() cannot be done in the ResourceManager destructor
cause ResourceData::resetAll accesses NIE::url() and NAO::identifier(),
both of which are also static variables and could have been destroyed
before.
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;">Managed to reproduce the exact crash -
void TestObject::main()
{
static Nepomuk2::Resource res(QUrl("nepomuk:/res/49c25a0b-17fe-43f2-be67-9d6f6d268cac"));
res.properties();
QCoreApplication::instance()->quit();
}
This resource now gets cleared in ResourceManager::cleanupResources
</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/resource.h <span style="color: grey">(de8fee8)</span></li>
<li>libnepomukcore/resource/resourcemanager.h <span style="color: grey">(3c26733)</span></li>
<li>libnepomukcore/resource/resourcemanager.cpp <span style="color: grey">(457c042)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/107575/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>