Skip to content

Commit

Permalink
VideoManager: Fix Crash on Exit
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Nov 23, 2024
1 parent 73a4581 commit b9fe7b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/VideoManager/VideoManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ VideoManager::~VideoManager()
}

if (videoReceiver.sink != nullptr) {
// TODO: How to detect video backend type?
// qgcApp()->toolbox()->corePlugin()->releaseVideoSink(videoReceiver.sink);
#ifdef QGC_GST_STREAMING
qgcApp()->toolbox()->corePlugin()->releaseVideoSink(videoReceiver.sink);
// FIXME: AV: we need some interaface for video sink with .release() call
// Currently VideoManager is destroyed after corePlugin() and we are crashing on app exit
// calling _toolbox->corePlugin()->releaseVideoSink(_videoSink[i]);
// As for now let's call GStreamer::releaseVideoSink() directly
GStreamer::releaseVideoSink(videoReceiver.sink);
#elif defined(QGC_QT_STREAMING)
QtMultimediaReceiver::releaseVideoSink(videoReceiver.sink);
#endif
Expand Down

0 comments on commit b9fe7b0

Please sign in to comment.