Skip to content

Commit 5c50c69

Browse files
committed
SctpTransport::Instances was not being freed causing memory leak warnings
1 parent 27e807f commit 5c50c69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/impl/sctptransport.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class SctpTransport::InstancesSet {
8282
std::shared_mutex mMutex;
8383
};
8484

85-
SctpTransport::InstancesSet *SctpTransport::Instances = new InstancesSet;
85+
std::unique_ptr<SctpTransport::InstancesSet> SctpTransport::Instances = std::make_unique<InstancesSet>();
8686

8787
void SctpTransport::Init() {
8888
usrsctp_init(0, SctpTransport::WriteCallback, SctpTransport::DebugCallback);

src/impl/sctptransport.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class SctpTransport final : public Transport, public std::enable_shared_from_thi
127127
static void DebugCallback(const char *format, ...);
128128

129129
class InstancesSet;
130-
static InstancesSet *Instances;
130+
static std::unique_ptr<InstancesSet> Instances;
131131
};
132132

133133
} // namespace rtc::impl

0 commit comments

Comments
 (0)