plugins/screencast: Destroy renegotiate event

If I'm not mistaken, the renegotiate event is leaked. Also, its handler
function can be hypothetically called after thhe ScreenCastStream object
is destroyed.
This commit is contained in:
Vlad Zahorodnii 2024-03-31 18:19:14 +03:00
parent 0c49ae5360
commit 4c384d1e9f

View file

@ -360,6 +360,10 @@ ScreenCastStream::ScreenCastStream(ScreenCastSource *source, std::shared_ptr<Pip
ScreenCastStream::~ScreenCastStream()
{
m_closed = true;
if (m_pwRenegotiate) {
pw_loop_destroy_source(m_pwCore->pwMainLoop, m_pwRenegotiate);
}
if (m_pwStream) {
pw_stream_destroy(m_pwStream);
}