From 0a0b14e2c6a44fa77fc8a40fd77bed866dd9565d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 28 Jun 2024 10:01:02 +0200 Subject: [PATCH] video_rxtx: don't unregister callb. if not regist. Do not unregister the should_exit callback if not registsterd. This occurs eg. when invalid host was entered, like: `uv blah`. --- src/video_rxtx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_rxtx.cpp b/src/video_rxtx.cpp index 963a4b649..758db2817 100644 --- a/src/video_rxtx.cpp +++ b/src/video_rxtx.cpp @@ -113,7 +113,6 @@ static void should_exit_video_rxtx(void *state) { video_rxtx::~video_rxtx() { join(); - unregister_should_exit_callback(m_parent, should_exit_video_rxtx, this); if (!m_poisoned && m_compression) { send(NULL); compress_pop(m_compression); @@ -139,6 +138,7 @@ void video_rxtx::join() { } send(NULL); // pass poisoned pill pthread_join(m_thread_id, NULL); + unregister_should_exit_callback(m_parent, should_exit_video_rxtx, this); m_joined = true; }