[gnome-games] retro-runner: Don't use descriptor URI as media for standalone games



commit 70a725eb07007c97a59634778d75135416a0cd6d
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Mar 30 02:53:36 2020 +0500

    retro-runner: Don't use descriptor URI as media for standalone games
    
    This caused Craft core to crash.

 src/retro/retro-runner.vala | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 0f4b1931..07711242 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -67,9 +67,11 @@ public class Games.RetroRunner : Object, Runner {
        private bool core_loaded;
        private bool is_error;
 
-       private RetroRunner (Game game) {
+       public RetroRunner.from_source (Game game, RetroCoreSource source) {
                this.game = game;
 
+               core_source = source;
+
                _media_set = game.media_set;
                if (media_set == null && game.uri != null) {
                        var media = new Media ();
@@ -77,22 +79,17 @@ public class Games.RetroRunner : Object, Runner {
 
                        _media_set = new MediaSet ();
                        _media_set.add_media (media);
-
                }
 
                _media_set.notify["selected-media-number"].connect (on_media_number_changed);
        }
 
-       public RetroRunner.from_source (Game game, RetroCoreSource source) {
-               this (game);
-
-               core_source = source;
-       }
-
        public RetroRunner.from_descriptor (Game game, Retro.CoreDescriptor descriptor) {
-               this (game);
+               this.game = game;
 
                core_descriptor = descriptor;
+
+               _media_set = new MediaSet ();
        }
 
        construct {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]