<div class="gmail_quote">On Mon, Dec 20, 2010 at 12:51 PM, Dmitry Risenberg <span dir="ltr"><<a href="mailto:dmitry.risenberg@gmail.com">dmitry.risenberg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2010/12/20 Aleix Pol <<a href="mailto:aleixpol@kde.org">aleixpol@kde.org</a>>:<br>
<div class="im">> Maybe you could try to explore why is this crashing? I don't like to change<br>
> the plugin interface to provide errors, we could end up with code checking<br>
> if plugins are wrong all over the place.<br>
> Aleix<br>
<br>
</div>The reason is that the plugin object returned from<br>
KServiceTypeTrader::createInstanceFromQuery (plugincontroller.cpp:435)<br>
is used by some later initialization code, particularly in<br>
ProjectPrivate::loadVersionControlPlugin, and this code does not know<br>
that the plugin has in fact been unloaded. Unloading via<br>
PluginController::unloadPlugin deletes the plugin object, so accessing<br>
it later is accessing freed memory.<br>
To sum up, the plugin itself cannot know whether it is safe to unload<br>
at a given moment, so it is up to PluginController to decide, which,<br>
in turn, has to check for errors. In fact it seems strange that there<br>
is no error reporting mechanism, and it is just assumed that the<br>
plugin always loads correctly.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Dmitry Risenberg<br>
<br>
--<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</div></div></blockquote></div><br><div>On the other hand, plugins can be unloaded by the user and we have to be prepared for that.</div><div><br></div><div>Aleix</div>