Wrong QSharedDataPointer<Private> in kdelibs?

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Wed Apr 23 20:52:24 BST 2008


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