kdevelop exitting on its own - GOTCHA!

Milian Wolff mail at milianw.de
Sat Nov 15 21:18:39 GMT 2014


On Saturday 15 November 2014 21:42:42 René J.V. Bertin wrote:
> On Saturday November 15 2014 21:23:44 Milian Wolff wrote:
> > I don't see it in those branches either.
> 
> I haven't found it either, nor any trace of KGlobal being inherited and
> ref/deref called that way.
> > Indeed, s_refCount being a plain int sounds troublesome. You could either:
> > 
> > a) add an assertion in there that its only ever being called form the main
> > 
> > thread:
> >     Q_ASSERT(QThread::currentThread() == qApp->thread())
> 
> But do we know whether this should only be called on the main thread? I
> would assume that's not the case, or is it "forbidden" to start a KJob from
> inside a KJob?

It is not threadsafe currently. So that would give us an indication on whats 
going on and where it might go wrong.

> > b) make it a QAtomicInt<int>
> > 
> > This should be the "fix" if we decide that this should be threadsafe.
> 
> Ah. So much for the modification I'm currently testing, but I take it
> QAtomicInt does the same as the interlocked increment/decrement?

LMGTFY: http://qt-project.org/doc/qt-4.8/qatomicint.html

Bye

-- 
Milian Wolff
mail at milianw.de
http://milianw.de



More information about the KDevelop mailing list