From d5e94651972510f2b7a608e7e9161ad58f09e8cb Mon Sep 17 00:00:00 2001 From: Kevin May Date: Thu, 7 Nov 2019 14:02:14 +0000 Subject: IVGCVSW-3987 Fix for potential unique_ptr.release() bug * Use an android strong pointer instead of a unique_ptr to avoid undefined behaviour of releasing unique_ptr to strong pointer Signed-off-by: Kevin May Change-Id: Icac255ba2407796888f20ffaba99a7988cb6f63c --- ArmnnDriverImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp index 64188bbf..de80445a 100644 --- a/ArmnnDriverImpl.cpp +++ b/ArmnnDriverImpl.cpp @@ -150,7 +150,7 @@ Return ArmnnDriverImpl::prepareModel( return ErrorStatus::NONE; } - unique_ptr> preparedModel( + sp> preparedModel( new ArmnnPreparedModel( netId, runtime.get(), @@ -180,7 +180,7 @@ Return ArmnnDriverImpl::prepareModel( } } - NotifyCallbackAndCheck(cb, ErrorStatus::NONE, preparedModel.release()); + NotifyCallbackAndCheck(cb, ErrorStatus::NONE, preparedModel); return ErrorStatus::NONE; } -- cgit v1.2.1