diff --git a/src/impl/sctptransport.cpp b/src/impl/sctptransport.cpp index 0946d2542..6afe77214 100644 --- a/src/impl/sctptransport.cpp +++ b/src/impl/sctptransport.cpp @@ -82,7 +82,7 @@ class SctpTransport::InstancesSet { std::shared_mutex mMutex; }; -SctpTransport::InstancesSet *SctpTransport::Instances = new InstancesSet; +std::unique_ptr SctpTransport::Instances = std::make_unique(); void SctpTransport::Init() { usrsctp_init(0, SctpTransport::WriteCallback, SctpTransport::DebugCallback); diff --git a/src/impl/sctptransport.hpp b/src/impl/sctptransport.hpp index 82b02a70c..4e1a9a02e 100644 --- a/src/impl/sctptransport.hpp +++ b/src/impl/sctptransport.hpp @@ -127,7 +127,7 @@ class SctpTransport final : public Transport, public std::enable_shared_from_thi static void DebugCallback(const char *format, ...); class InstancesSet; - static InstancesSet *Instances; + static std::unique_ptr Instances; }; } // namespace rtc::impl