Wrong QSharedDataPointer<Private> in kdelibs?

Nicolas Ternisien nicolas.ternisien at gmail.com
Thu Apr 24 08:36:27 BST 2008


In fact, no, you didn't notive that it's QSharedDataPointer<Private>
and not QSharedDataPointer<Private>* ;-)

On Wed, Apr 23, 2008 at 9:52 PM, Christian Ehrlicher
<Ch.Ehrlicher at gmx.de> wrote:
> Thiago Macieira schrieb:
>
>
> > Christian Ehrlicher wrote:
> >
> > > Hi,
> > >
> > > Everywhere in kdelibs I see such constructs:
> > >
> > > QSharedDataPointer<Private> d;
> > >
> > > KFoo::KFoo() : d(new Private())
> > > {}
> > >
> > > KFoo::~KFoo()
> > > {}
> > >
> > >
> > > I'm missing 'delete d' in dtor - or do I miss something here?
> > >
> >
> > You're missing the QSharedDataPointer destructor. It takes care of that
> for you.
> >
> >
>  My problem was that i did not notice that it's QSharedDataPointer<Private>
> and not QSharedDataPointer<Private*>.
>
>  Christian
>




More information about the kde-core-devel mailing list