From dad4f886d1cb717a645d0878c1354dfde768e823 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Fri, 3 Jan 2025 16:44:25 -0500 Subject: [PATCH] fix missing increment of the reference count on every call to startup() fixes #3098 --- srtcore/api.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srtcore/api.cpp b/srtcore/api.cpp index bb5dd64fe..ddae607da 100644 --- a/srtcore/api.cpp +++ b/srtcore/api.cpp @@ -236,10 +236,10 @@ string srt::CUDTUnited::CONID(SRTSOCKET sock) int srt::CUDTUnited::startup() { ScopedLock gcinit(m_InitLock); - if (m_bGCStatus) + if (m_iInstanceCount++ > 0) return 1; - if (m_iInstanceCount++ > 0) + if (m_bGCStatus) return 1; // Global initialization code