Fix socket leak in moodbarpipeline

Fixes #4663
When tearing down the pipeline, there was a leak of a GstBus which holds a socketpair open.
Eventually the OS runs out of file descriptors and terminates Clementine.
This commit is contained in:
Mark Furneaux 2014-12-22 16:13:44 -05:00
parent efa58bb852
commit 3886f3d1e4
1 changed files with 4 additions and 2 deletions

View File

@ -190,8 +190,10 @@ void MoodbarPipeline::Cleanup() {
Q_ASSERT(QThread::currentThread() != qApp->thread());
if (pipeline_) {
gst_bus_set_sync_handler(gst_pipeline_get_bus(GST_PIPELINE(pipeline_)),
nullptr, nullptr, nullptr);
GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline_));
gst_bus_set_sync_handler(bus, nullptr, nullptr, nullptr);
gst_object_unref(bus);
gst_element_set_state(pipeline_, GST_STATE_NULL);
gst_object_unref(pipeline_);
pipeline_ = nullptr;