Commit 428d3c99 authored by Jan Grulich's avatar Jan Grulich

Avoid disabling the stream twice

parent 425abd65
......@@ -225,8 +225,10 @@ bool WaylandIntegration::WaylandIntegrationPrivate::startStreaming(const Wayland
disconnect(m_stream, &ScreenCastStream::streamReady, this, nullptr);
if (!streamReady) {
if (m_stream) {
delete m_stream;
m_stream = nullptr;
}
return false;
}
......@@ -249,8 +251,10 @@ bool WaylandIntegration::WaylandIntegrationPrivate::startStreaming(const Wayland
return true;
}
if (m_stream) {
delete m_stream;
m_stream = nullptr;
}
qCWarning(XdgDesktopPortalKdeWaylandIntegration) << "Failed to start streaming: no remote access manager interface";
return false;
......@@ -259,6 +263,8 @@ bool WaylandIntegration::WaylandIntegrationPrivate::startStreaming(const Wayland
void WaylandIntegration::WaylandIntegrationPrivate::stopStreaming()
{
if (m_streamingEnabled) {
m_streamingEnabled = false;
// First unbound outputs and destroy remote access manager so we no longer receive buffers
if (m_remoteAccessManager) {
m_remoteAccessManager->release();
......@@ -271,7 +277,6 @@ void WaylandIntegration::WaylandIntegrationPrivate::stopStreaming()
delete m_stream;
m_stream = nullptr;
}
m_streamingEnabled = false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment