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

Aleix Pol aleixpol at kde.org
Mon Dec 20 01:38:00 UTC 2010


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

On Sat, Dec 18, 2010 at 9:53 PM, Dmitry Risenberg <
dmitry.risenberg at gmail.com> wrote:

> > virtual bool unloadPlugin( const QString & plugin ) = 0;
> >
> > from a delayed slot, i.e. in the ctor of the plugin do:
> >
> > if (!gitInstalled) {
> >  QMetaObject::invokeMethod(this, "unloadDelayed");
> >  return;
> > }
> >
> > then:
> >
> > private slots:
> >  void unloadDelayed() {
> >    KDevelop::ICore::self()->pluginController()->unloadPlugin("git");
> >    // or whatever the name is here...
> >  }
>
> Tried this - it did not work, because once a plugin object is created
> in PluginController::loadPluginInternal, it is passed upwards, in this
> case - to ProjecPrivatet::loadVersionControlPlugin. If the plugin is
> unloaded in the process, then the passed object is in fact invalid,
> and calling its methods leads to a crash. In my version the created
> plugin object gets discarded if it has an error - the anticipated
> design was to throw an exception from the constructor, which is not
> safe in this context, so there are these hasError/errorDescription
> methods.
>
> Here's the actual patch I tried: http://pastebin.com/vDd9cpiB.
>
> --
> Dmitry Risenberg
>
> --
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20101220/46ccabad/attachment.html>


More information about the KDevelop-devel mailing list