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

--- Comment #24 from David Nolden <david.nolden....@art-master.de> ---
I've checked the identities, and all the duchain item identities that you
mentioned before belong to the kdev-python plugin, so my guess is now that the
kdev-python plugin was unloaded.

I've further thought about the problem, and I think that these measures are
necessary to solve this properly:

1. We should never unload language plugins. We can unregister them from the UI,
but the shared library should not actually be unloaded. It is not safe to do
it, because special types/declarations/contexts defined in this language plugin
may still be in the shorted lived duchain cache, and the on-disk duchain cache
may contain items for from this plugin that need to be cleaned/deleted.

2. While doing any duchain operations (like cleanup), we have to make sure that
the corresponding language plugins are loaded whenever touching a certain item.
E.g. when a top-context for kdev-python is loaded, we have to make sure that
the plugin is loaded before that. This is practically not a problem at the
moment though, because these items are usually loaded when a corresponding file
is opened in the editor, and therefore, the language plugin is available.
However, at least theoretically, this could be a problem during certain cleanup
operations.

In the long term, it would probably be best to put the duchain specific parts
of language plugins into separate libraries, and statically preload these at
KDevelop startup, and unload them during shutdown, but don't do any dynamic
loading/unloading on them at runtime.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to