Skip to content
Commit 50de4e84 authored by Igor Kushnir's avatar Igor Kushnir Committed by Milian Wolff
Browse files

ItemRepositoryRegistry: don't access uninitialized d-pointer

My recent commit "Eliminate ItemRepositoryRegistryPrivate::open()"
moved code from ItemRepositoryRegistryPrivate::open() into
ItemRepositoryRegistryPrivate's constructor. ItemRepositoryRegistry's
d-pointer is not initialized during its ItemRepositoryRegistryPrivate's
construction, and so must not be referenced.

Move code from ItemRepositoryRegistry::customCounter() into a new
function ItemRepositoryRegistryPrivate::customCounter(); call the new
function from the old one and from ItemRepositoryRegistryPrivate's ctor.

This fixes the following segmentation fault at KDevelop start:
QMap<QString, QAtomicInt*>::detach() (this=0x563b5bc08) at /usr/include/qt/QtCore/qmap.h:361
QMap<QString, QAtomicInt*>::find(QString const&) (this=0x563b5bc08, akey=...) at /usr/include/qt/QtCore/qmap.h:865
KDevelop::ItemRepositoryRegistry::customCounter(QString const&, int) (this=0x563b5bbc8700, identity=..., initialValue=0) at .../kdevelop/kdevplatform/serialization/itemrepositoryregistry.cpp:174
KDevelop::ItemRepositoryRegistryPrivate::ItemRepositoryRegistryPrivate(KDevelop::ItemRepositoryRegistry&, QString const&) (this=0x563b5bbc8720, owner=..., path=...) at .../kdevelop/kdevplatform/serialization/itemrepositoryregistry.cpp:288
KDevelop::ItemRepositoryRegistry::ItemRepositoryRegistry(QString const&) (this=0x563b5bbc8700, repositoryPath=...) at .../kdevelop/kdevplatform/serialization/itemrepositoryregistry.cpp:128
KDevelop::ItemRepositoryRegistry::initialize(QString const&) (repositoryPath=...) at .../kdevelop/kdevplatform/serialization/itemrepositoryregistry.cpp:137
KDevelop::DUChain::initialize() () at .../kdevelop/kdevplatform/language/duchain/duchain.cpp:1284
KDevelop::CorePrivate::initialize(KDevelop::Core::Setup, QString const&) (this=0x563b5b187800, mode=KDevelop::Core::Default, session=...) at .../kdevelop/kdevplatform/shell/core.cpp:196
KDevelop::Core::initialize(KDevelop::Core::Setup, QString const&) (mode=KDevelop::Core::Default, session=...) at .../kdevelop/kdevplatform/shell/core.cpp:286
main(int, char**) (argc=3, argv=0x7fff678463b8) at .../kdevelop/app/main.cpp:752
parent 15f1d789
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment