[kdevplatform] language/duchain/navigation: Make the AbstractNavigationContext a KShared instead of KSharedObject

Milian Wolff mail at milianw.de
Fri Oct 25 09:45:13 UTC 2013


On Thursday 24 October 2013 21:46:44 Aleix Pol wrote:
> On Thu, Oct 24, 2013 at 6:49 PM, Milian Wolff <mail at milianw.de> wrote:
> > On Thursday 24 October 2013 15:58:10 Aleix Pol wrote:
> > > Git commit a8859089ddac283ef0a3b2d886609cc4705e87ff by Aleix Pol.
> > > Committed on 24/10/2013 at 15:53.
> > > Pushed by apol into branch 'master'.
> > > 
> > > Make the AbstractNavigationContext a KShared instead of KSharedObject
> > > 
> > > Fixes crash when hovering a preprocessor macro, the tooltip destruction
> > > would crash.
> > > 
> > > BUG: 326472
> > 
> > <snip>
> > 
> > > -class KDEVPLATFORMLANGUAGE_EXPORT AbstractNavigationContext : public
> > > QObject, public KSharedObject
> > > +class KDEVPLATFORMLANGUAGE_EXPORT
> > > AbstractNavigationContext : public QObject, public KShared {
> > > 
> > >    Q_OBJECT
> > 
> > >    public:
> > Why is this "shared" at all? If it's a QObject you don't have value
> > semantics
> > anyways (cf. Q_DISABLE_COPY). With pointer semantics, you don't need
> > "sharing"
> > or am I missing something?
>
> Well, it's only used for the ref-counting, it doesn't really have anything
> to do with the copy semantics...

Ah, of course - my bad. KShared is an intrusive shared-pointer data type, and 
should just be replaced by QSharedPointer. I.e. we should get rid of KShared 
and KSharedPointer.

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


More information about the KDevelop-devel mailing list