aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-10 10:45:35 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-01-12 12:24:40 +0000
commitff1f5a1765bad5973488b7b49c6142411cdee607 (patch)
treeb22c779659a2dc892fe3fa41694a94e05f02768e
parent767639d1fcd79132776e67af9d8ddab38506514b (diff)
libshiboken: Fix warning about using deprecated std::auto_ptr
Replace usage of auto_ptr by a delete statement, which also makes the intention of the code clearer. Change-Id: Ida69b8df00f6a86c43547f013c799b8ccd66f60d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--libshiboken/conversions.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h
index a624d95..599497d 100644
--- a/libshiboken/conversions.h
+++ b/libshiboken/conversions.h
@@ -42,7 +42,6 @@
#include "sbkpython.h"
#include <limits>
-#include <memory>
#include <typeinfo>
#include "sbkstring.h"
@@ -205,8 +204,9 @@ struct ValueTypeConverter
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<T>());
if (ObjectType::hasExternalCppConversions(shiboType) && isConvertible(pyobj)) {
T* cptr = reinterpret_cast<T*>(ObjectType::callExternalCppConversion(shiboType, pyobj));
- std::auto_ptr<T> cptr_auto_ptr(cptr);
- return *cptr;
+ const T result = *cptr;
+ delete cptr;
+ return result;
}
assert(false);
}