MCPcopy Create free account
hub / github.com/KDE/kdevelop / shutdown

Method shutdown

kdevplatform/language/duchain/duchain.cpp:1733–1766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1731}
1732
1733void DUChain::shutdown()
1734{
1735 // if core is not shutting down, we can end up in deadlocks or crashes
1736 // since language plugins might still try to access static duchain stuff
1737 Q_ASSERT(!ICore::self() || ICore::self()->shuttingDown());
1738
1739 qCDebug(LANGUAGE) << "Cleaning up and shutting down DUChain";
1740
1741 QMutexLocker lock(&sdDUChainPrivate->cleanupMutex());
1742
1743 {
1744 //Acquire write-lock of the repository, so when kdevelop crashes in that process, the repository is discarded
1745 //Crashes here may happen in an inconsistent state, thus this makes sense, to protect the user from more crashes
1746 globalItemRepositoryRegistry().lockForWriting();
1747 sdDUChainPrivate->cleanupTopContexts();
1748 globalItemRepositoryRegistry().unlockForWriting();
1749 }
1750
1751 sdDUChainPrivate->doMoreCleanup(); //Must be done _before_ finalCleanup, else we may be deleting yet needed data
1752
1753 sdDUChainPrivate->m_openDocumentContexts.clear();
1754 sdDUChainPrivate->m_destroyed = true;
1755 sdDUChainPrivate->clear();
1756
1757 {
1758 //Acquire write-lock of the repository, so when kdevelop crashes in that process, the repository is discarded
1759 //Crashes here may happen in an inconsistent state, thus this makes sense, to protect the user from more crashes
1760 globalItemRepositoryRegistry().lockForWriting();
1761 finalCleanup();
1762 globalItemRepositoryRegistry().unlockForWriting();
1763 }
1764
1765 globalItemRepositoryRegistry().shutdown();
1766}
1767
1768uint DUChain::newTopContextIndex()
1769{

Callers 1

runTestMethod · 0.45

Calls 7

finalCleanupFunction · 0.85
shuttingDownMethod · 0.80
lockForWritingMethod · 0.80
cleanupTopContextsMethod · 0.80
unlockForWritingMethod · 0.80
doMoreCleanupMethod · 0.80
clearMethod · 0.45

Tested by 1

runTestMethod · 0.36