From d7a435fb5b437ce62b4a0e026c61ecc032bd1f59 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 13 Jan 2023 22:40:19 -0800 Subject: [PATCH] Use proper return for CFactoryFnReturn::GetObjForTransfer --- include/Kyoto/CFactoryMgr.hpp | 2 +- src/Kyoto/CObjectReference.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Kyoto/CFactoryMgr.hpp b/include/Kyoto/CFactoryMgr.hpp index 0b5c078c..6d9c46f2 100644 --- a/include/Kyoto/CFactoryMgr.hpp +++ b/include/Kyoto/CFactoryMgr.hpp @@ -18,7 +18,7 @@ public: template < typename T > CFactoryFnReturn(T* ptr) : obj(TToken< T >::GetIObjObjectFor(ptr).release()) {} - IObj* GetObjForTransfer() const { return obj.release(); } + const rstl::auto_ptr& GetObjForTransfer() const { return obj; } private: rstl::auto_ptr< CObjOwnerDerivedFromIObjUntyped > obj; }; diff --git a/src/Kyoto/CObjectReference.cpp b/src/Kyoto/CObjectReference.cpp index c13590e2..4bb2f45e 100644 --- a/src/Kyoto/CObjectReference.cpp +++ b/src/Kyoto/CObjectReference.cpp @@ -40,7 +40,7 @@ void CObjectReference::Lock() { IObj* CObjectReference::GetObject() { if (x10_object == nullptr) { - x10_object = xc_objectStore->GetFactory().Build(x4_objTag, x14_params).GetObjForTransfer(); + x10_object = xc_objectStore->GetFactory().Build(x4_objTag, x14_params).GetObjForTransfer().release(); } x3_loading = false; return x10_object;