[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 292996] Crash in Nepomuk::Resource::~Resource
From:       Vishesh Handa <me () vhanda ! in>
Date:       2012-12-10 9:17:43
Message-ID: bug-292996-17878-S4FdaWbcfS () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=292996

Vishesh Handa <me@vhanda.in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Version Fixed In|                            |4.10
         Resolution|---                         |FIXED
      Latest Commit|                            |http://commits.kde.org/nepo
                   |                            |muk-core/712879840c661b1246
                   |                            |e1c69cf338fb6c36aee51e

--- Comment #14 from Vishesh Handa <me@vhanda.in> ---
Git commit 712879840c661b1246e1c69cf338fb6c36aee51e by Vishesh Handa.
Committed on 04/12/2012 at 12:20.
Pushed by vhanda into branch 'master'.

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.
FIXED-IN: 4.10
REVIEW: 107575

M  +2    -0    libnepomukcore/resource/resource.h
M  +20   -0    libnepomukcore/resource/resourcemanager.cpp
M  +7    -0    libnepomukcore/resource/resourcemanager.h

http://commits.kde.org/nepomuk-core/712879840c661b1246e1c69cf338fb6c36aee51e

-- 
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic