[beast: 9/9] BEAST: fix crash when adding a bus to the mixer while song is playing



commit 2da35576e444e6957a5b1bf40d30c7d25ecd34db
Author: Stefan Westerfeld <stefan space twc de>
Date:   Fri Jun 30 21:55:00 2017 +0200

    BEAST: fix crash when adding a bus to the mixer while song is playing
    
    While the song is playing, adding a bus calls song.create_bus() which returns
    NULL, so we cannot call methods on that handle.
    
    Signed-off-by: Stefan Westerfeld <stefan space twc de>

 beast-gtk/bstbusmixer.cc |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/beast-gtk/bstbusmixer.cc b/beast-gtk/bstbusmixer.cc
index ed35e04..7d46d98 100644
--- a/beast-gtk/bstbusmixer.cc
+++ b/beast-gtk/bstbusmixer.cc
@@ -178,9 +178,12 @@ bus_mixer_action_exec (gpointer data,
       {
         bse_item_group_undo (song.proxy_id(), "Create Bus");
         Bse::BusH bus = song.create_bus();
-        bus.ensure_output();
+        if (bus)
+          {
+            bus.ensure_output();
+            bst_item_view_select (iview, bus.proxy_id());
+          }
         bse_item_ungroup_undo (song.proxy_id());
-        bst_item_view_select (iview, bus.proxy_id());
       }
       break;
     case ACTION_DELETE_BUS:


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