[KDevPlatform/1.2] 5774a52: Check that git is installed when loading Git Suppo

Dmitry Risenberg dmitry.risenberg at gmail.com
Mon Dec 20 11:51:54 UTC 2010


2010/12/20 Aleix Pol <aleixpol at kde.org>:
> Maybe you could try to explore why is this crashing? I don't like to change
> the plugin interface to provide errors, we could end up with code checking
> if plugins are wrong all over the place.
> Aleix

The reason is that the plugin object returned from
KServiceTypeTrader::createInstanceFromQuery (plugincontroller.cpp:435)
is used by some later initialization code, particularly in
ProjectPrivate::loadVersionControlPlugin, and this code does not know
that the plugin has in fact been unloaded. Unloading via
PluginController::unloadPlugin deletes the plugin object, so accessing
it later is accessing freed memory.
To sum up, the plugin itself cannot know whether it is safe to unload
at a given moment, so it is up to PluginController to decide, which,
in turn, has to check for errors. In fact it seems strange that there
is no error reporting mechanism, and it is just assumed that the
plugin always loads correctly.

-- 
Dmitry Risenberg




More information about the KDevelop-devel mailing list