diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-15 01:26:14 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-16 13:53:03 +0200 |
commit | aa442e9450c8a288b8aaa2dda79ccb69d8774429 (patch) | |
tree | 516dddeab5bd41bea608259b96179c2eb90c3110 /tests | |
parent | 7745b49b2d7699334d0967d41535b1e162046860 (diff) |
Q(E)SDP(V2): fill the API gap left by take()
take() returns a pointer to the shared data object *without*
decrementing the reference counter. The primary use case
is adopting the object from a Q(E)SDP into a different reference
counting mechanism. This is fine, but if we support the
"extraction" part, we shall also support the "adoption" part.
Also, the API for the shared data pointer classes should
match.
Add an adopting tag type and suitable constructors to the
shared data pointer classes, and add take() to the classes
lacking it.
Drive by, apply qExchange to take()'s implementation.
[ChangeLog][QtCore][QAdoptSharedDataTag] New class.
It is now possible to adopt pointers to shared data into
a QExplicitlySharedDataPointer or a QSharedDataPointer object
without incrementing the object's reference counter.
Change-Id: I62b8b005c1bfbe2add58566206fca27634bb7e70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions