From 04a10d70b3df9db299cd9d4c756abff3a655c1cf Mon Sep 17 00:00:00 2001 From: sbkyy <337650377@qq.com> Date: Thu, 24 Oct 2024 17:38:10 +0800 Subject: [PATCH] =?UTF-8?q?/index/api/stack/reset=20=E5=9C=A8=E7=9B=B8?= =?UTF-8?q?=E5=90=8Curl=E5=92=8C=E9=80=9A=E5=88=86=E8=BE=A8=E7=8E=87?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E8=B0=83=E7=94=A8channel=E6=9E=90=E6=9E=84?= =?UTF-8?q?=E6=B2=A1=E7=94=BB=E9=9D=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/VideoStack.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/VideoStack.cpp b/server/VideoStack.cpp index 76b5ad49..bfa9bb1f 100644 --- a/server/VideoStack.cpp +++ b/server/VideoStack.cpp @@ -23,7 +23,11 @@ INSTANCE_IMP(VideoStackManager) -Param::~Param() { VideoStackManager::Instance().unrefChannel(id, width, height, pixfmt); } +Param::~Param() { + auto strongChn= weak_chn.lock(); + if (!strongChn) { return; } + VideoStackManager::Instance().unrefChannel(id, width, height, pixfmt); +} Channel::Channel(const std::string& id, int width, int height, AVPixelFormat pixfmt) : _id(id), _width(width), _height(height), _pixfmt(pixfmt) {