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`.
This commit is contained in:
Martin Pulec
2024-06-28 10:01:02 +02:00
parent b4bf412a7a
commit 0a0b14e2c6

View File

@@ -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;
}