[Kst] Re: branches/work/kst/portto4-sharedpointer

Peter Kümmel syntheticpp at gmx.net
Thu Jan 6 14:08:56 CET 2011


> But I wanna use QSharedPointer for our implementation because it is thread-safe.
> Attached my new sharedptr.h. With help of QWeakPointer we could switch between
> raw pointer and shared pointer.

I've updated the branch with my implementation. But I don't know if
it's worth to do the changes in trunk.

Attached patch shows the changes. Most files are touched because of
the protected destructor. SharedPtr only works with QObject as base
classe, so it could rely on qobject_cast.

Next step would be to check if we need the "use" flags. Isn't
it superfluous when all objects which are not used would be deleted?
Such a flag looks like a second reference count.

But I stop here now, as I don't think it will improve a lot.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: weak.patch
Type: text/x-patch
Size: 32898 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kst/attachments/20110106/c1e230a4/attachment-0001.patch 


More information about the Kst mailing list