Using libraries with std::shared_ptrs

JC_Denton
Sun, 21 May 2023 05:16:15 +0000
C++

I have a third party library that I need to include in my Unreal project. This library is full of std::shared_ptr and expects std::shared_ptrs as part of its API. Its not really feasable to swap them all to TSharedPtr.
I will of course use TSharedPtrs wherever possible, but what are my options here?
How can I safely create std::shared_ptrs on the heap without destroying the Unreal memory system/garbage collection etc?

4 posts - 3 participants