diff --git a/playback/player/qt/qgstplayer.cpp b/playback/player/qt/qgstplayer.cpp index ab140f37a7..3aae93d916 100644 --- a/playback/player/qt/qgstplayer.cpp +++ b/playback/player/qt/qgstplayer.cpp @@ -359,6 +359,15 @@ Player::Player(QObject *parent, VideoRenderer *renderer) gst_player_set_subtitle_track_enabled(player_, false); } +Player::~Player() +{ + if (player_) { + g_signal_handlers_disconnect_by_data(player_, this); + gst_player_stop(player_); + g_object_unref(player_); + } +} + void Player::onStateChanged(Player * player, GstPlayerState state) { diff --git a/playback/player/qt/qgstplayer.h b/playback/player/qt/qgstplayer.h index f5d4ab810f..c060bc99a1 100644 --- a/playback/player/qt/qgstplayer.h +++ b/playback/player/qt/qgstplayer.h @@ -62,6 +62,7 @@ class Player : public QObject public: explicit Player(QObject *parent = 0, VideoRenderer *renderer = 0); + virtual ~Player(); typedef GstPlayerError Error; enum State {