[Nepomuk] Review Request: ResourceWatcher: Do no create a new ResourceManager on quit
Commit Hook
null at kde.org
Mon Dec 10 09:17:40 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107573/#review23256
-----------------------------------------------------------
This review has been submitted with commit 5632983386e998d67954f7a7de470bab2184eaf3 by Vishesh Handa to branch master.
- Commit Hook
On Dec. 6, 2012, 8:40 a.m., Vishesh Handa wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107573/
> -----------------------------------------------------------
>
> (Updated Dec. 6, 2012, 8:40 a.m.)
>
>
> Review request for Nepomuk, Sebastian Trueg and Simeon Bird.
>
>
> Description
> -------
>
> ResourceWatcher: Do no create a new ResourceManager on quit
>
> The ResourceManager contains a ResourceWatcher. This ResourceWatcher is
> initialized only when a Resource class requires it. On destruction it
> calls ResourceWatcher::stop, which tries to disconnect it from
> ResourceManager::nepomukSystemStarted signal.
>
> The problem arises when the application is exiting, and the
> ResourceManager (being a child of QCoreApplication) is being destroyed.
> It in turn destroys the ResourceWatcher, which calls
> ResourceWatcher::stop, which calls ResourceManager::instance() which
> results in the creation of a new ResourceManager whose parent is
> QCoreApplication::instance, which is 0, cause the application is
> shutting down.
>
> This whole extra ResourceManager being allocated is not required and can
> be avoided by checking if QCoreApplication != 0, in
> ResourceManager::instance.
>
> Also, since ResourceManager::instance() can now return 0. I've added an
> assert check in the Resource class.
>
>
> Diffs
> -----
>
> libnepomukcore/datamanagement/resourcewatcher.cpp a09b646
> libnepomukcore/resource/resource.cpp 4601eba
> libnepomukcore/resource/resourcemanager.cpp 457c042
>
> Diff: http://git.reviewboard.kde.org/r/107573/diff/
>
>
> Testing
> -------
>
> Added breakpoints in gdb, and wrote a simple application. The extra ResourceManager is no longer being created.
>
>
> Thanks,
>
> Vishesh Handa
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20121210/6417fdf7/attachment.html>
More information about the Nepomuk
mailing list