global destruction (dis)order

Kevin Funk kfunk at
Wed Aug 9 07:57:35 UTC 2017

On Wednesday, 9 August 2017 09:41:23 CEST René J.V. Bertin wrote:
> On Tuesday August 08 2017 22:46:39 Kevin Funk wrote:
> >Which plugin? Source code?
> A rather simple KTextEditor plugin which I ported myself from KDE4 to KF5:
> github:RJVB/ZealSearch

Can't spot anything wrong here from a quick glance, looks like 
ZealSearchView's parent is properly set up, and you're removing the view from 
the factory just fine in ZealSearchView::~ZealSearchView().

m_mWin (used in ZealSearchView::~ZealSearchView()) should indeed be valid at 
that point; all the other Kate/KTE plugins use the pointer to the main window 

You'll need to debug more.

> I've been using that plugin for months without ever seeing this issue, but I
> know that is no guarantee that it is 100% correct. Maybe it's missing some
> code that tells KTextEditor when to unload it, causing it instead to be
> unloaded when its turn comes during global destruction?
> >Sounds like your plugin is not unloaded "soon enough". Do you still get the
> >warning with your plugin disabled?
> I can try (it's not exactly a frequent situation and I haven't yet figured
> out how to trigger it). But I don't think it's very likely that my plugin
> is the sole cause. For one, I hadn't been using it these times and don't
> think it would have executed its dtor multiple times without crashing
> before finally choking on a NULL pointer. Also, it doesn't use
> QMetaObject::invokeMethod(), so that part of the error comes from a
> different component.
> FWIW, the "0xDEADBEEF deleted without having been removed from the factory
> first." message would be much more useful if it printed the instance type.
> Surely that would be possible?

No, the object (this) is half-destructed at this point. The warning comes from 


> >This commit changed the plugin unloading behavior; but I don't see how that
> >
> >would cause your issue:
> >  * 6fb014383 - backgroundparser: Ensure jobs are finished on exit
> >  
> >    (2 days ago) <Kevin Funk>
> Does it postpone the unloading of all plugins? I've been test-driving that
> change almost since you proposed it so there too I would expect to have
> noticed issues before.
> Cheers,
> R.

Kevin Funk | kfunk at |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the KDevelop-devel mailing list