summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusdemarshaller.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-11-01 16:53:26 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-11-20 14:28:31 +0100
commit612a01be6513894ab1ec5a36b699a2142ba7f35c (patch)
tree4018c688b737c9b010677d2c419cb719b9ed9e68 /src/dbus/qdbusdemarshaller.cpp
parent5dd7e7b7a826d5d4314dffaaf20d465460616998 (diff)
Deprecate QScopedPointer::take()
We've decided that QScopedPointer shouldn't be movable, because it would break the semantics of being "scoped" (the pointer/pointee won't survive the scope). Then, QScopedPointer shouldn't allow for take() either. If you need those semantics, reach for unique_ptr. [ChangeLog][QtCore][QScopedPointer] The take() function has been deprecated. This was an API mistake, as it allowed the pointer/pointee to escape from the scope, defeating the point of the QScopedPointer class. If you need such semantics, use std::unique_ptr (and call release()). Change-Id: I3236f085f763b04eb98e3242abc06f7c54fb3d8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusdemarshaller.cpp')
-rw-r--r--src/dbus/qdbusdemarshaller.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dbus/qdbusdemarshaller.cpp b/src/dbus/qdbusdemarshaller.cpp
index c9da593ad2..39d2dd0354 100644
--- a/src/dbus/qdbusdemarshaller.cpp
+++ b/src/dbus/qdbusdemarshaller.cpp
@@ -40,7 +40,7 @@
#include "qdbusargument_p.h"
#include "qdbusconnection.h"
-#include <qscopedpointer.h>
+#include <memory>
#include <stdlib.h>
@@ -426,12 +426,12 @@ QDBusDemarshaller *QDBusDemarshaller::endCommon()
QDBusArgument QDBusDemarshaller::duplicate()
{
- QScopedPointer<QDBusDemarshaller> d(new QDBusDemarshaller(capabilities));
+ std::unique_ptr<QDBusDemarshaller> d(new QDBusDemarshaller(capabilities));
d->iterator = iterator;
d->message = q_dbus_message_ref(message);
q_dbus_message_iter_next(&iterator);
- return QDBusArgumentPrivate::create(d.take());
+ return QDBusArgumentPrivate::create(d.release());
}
QT_END_NAMESPACE