[retro-gtk] audio: Make PaPlayer.set_core() accept null
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [retro-gtk] audio: Make PaPlayer.set_core() accept null
- Date: Thu, 18 May 2017 12:21:48 +0000 (UTC)
commit c1309b851022368a1413ff5e5ba593c54ebb3fab
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu May 18 13:18:53 2017 +0200
    audio: Make PaPlayer.set_core() accept null
    
    This will help releasing references on the core.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782772
 retro-gtk/audio/pa-player.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/retro-gtk/audio/pa-player.vala b/retro-gtk/audio/pa-player.vala
index 6f5615a..970c49d 100644
--- a/retro-gtk/audio/pa-player.vala
+++ b/retro-gtk/audio/pa-player.vala
@@ -6,12 +6,15 @@ public class Retro.PaPlayer : GLib.Object {
        private double sample_rate;
        private PulseAudio.Simple simple;
 
-       public void set_core (Core core) {
+       public void set_core (Core? core) {
                if (this.core != null)
                        this.core.disconnect (on_audio_output_id);
 
                this.core = core;
-               on_audio_output_id = core.audio_output.connect (on_audio_output);
+
+               if (this.core != null)
+                       on_audio_output_id = core.audio_output.connect (on_audio_output);
+
                simple = null;
        }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]