Fix player process not exiting after window close

This commit is contained in:
Rafostar
2020-10-15 17:54:28 +02:00
parent 57a8e6d933
commit fa07c4532c
3 changed files with 7 additions and 6 deletions

View File

@@ -390,10 +390,7 @@ var App = GObject.registerClass({
_onWindowCloseRequest()
{
this.window.destroy();
this.player.widget.emit('destroy');
this.interface.emit('destroy');
this.quit();
}
});

View File

@@ -468,6 +468,13 @@ class ClapperInterface extends Gtk.Grid
_onDestroy()
{
this.disconnect(this.destroySignal);
if(
this._player
&& this._player.state !== GstPlayer.PlayerState.STOPPED
)
this._player.stop();
this.controls.emit('destroy');
}
});

View File

@@ -287,9 +287,6 @@ class ClapperPlayer extends GstPlayer.Player
while(this._playerSignals.length)
this.disconnect(this._playerSignals.pop());
if(this.state !== GstPlayer.PlayerState.STOPPED)
this.stop();
if(this.run_loop && this.loop.is_running())
this.loop.quit();
}