Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1 from adenexter/destruction-crash
[nemo-qtmultimedia-plugins] Fix crash on destruction during playback.
  • Loading branch information
adenexter committed May 14, 2014
2 parents 513e4b6 + 81473af commit db5b708
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/videotexturebackend/videotexturebackend.cpp
Expand Up @@ -463,6 +463,7 @@ private slots:
QSize m_nativeSize;
QSize m_textureSize;
QSize m_implicitSize;
gulong m_signalId;
int m_orientation;
int m_textureOrientation;
bool m_mirror;
Expand All @@ -476,6 +477,7 @@ NemoVideoTextureBackend::NemoVideoTextureBackend(QDeclarativeVideoOutput *parent
, m_sink(0)
, m_display(0)
, m_texture(0)
, m_signalId(0)
, m_orientation(0)
, m_textureOrientation(0)
, m_mirror(false)
Expand All @@ -497,15 +499,19 @@ NemoVideoTextureBackend::NemoVideoTextureBackend(QDeclarativeVideoOutput *parent

g_object_set(G_OBJECT(m_sink), "egl-display", m_display, NULL);

g_signal_connect(G_OBJECT(m_sink), "frame-ready", G_CALLBACK(frame_ready), this);
m_signalId = g_signal_connect(
G_OBJECT(m_sink), "frame-ready", G_CALLBACK(frame_ready), this);
}
}

NemoVideoTextureBackend::~NemoVideoTextureBackend()
{
releaseControl();

gst_object_unref(GST_OBJECT(m_sink));
if (m_sink) {
g_signal_handler_disconnect(G_OBJECT(m_sink), m_signalId);
gst_object_unref(GST_OBJECT(m_sink));
}

if (m_texture) {
m_texture->deleteLater();
Expand Down

0 comments on commit db5b708

Please sign in to comment.