Fix crash if new tempo is set to start at bar #0 / Follow-up for non movable meters
[ardour.git] / gtk2_ardour / axis_view.cc
index 7a449843e09055a306e6b9148eb7a9a6e5752c7b..5e36fc43c1e5a7bc04a4dcdeb38b0cf899c04eb1 100644 (file)
@@ -43,6 +43,7 @@ using namespace std;
 using namespace Gtk;
 using namespace Gtkmm2ext;
 using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
 
 list<Gdk::Color> AxisView::used_colors;
 
@@ -65,7 +66,14 @@ AxisView::unique_random_color()
 string
 AxisView::gui_property (const string& property_name) const
 {
-       return gui_object_state().get_string (state_id(), property_name);
+       if (property_hashtable.count(property_name)) {
+               return property_hashtable[property_name];
+       } else {
+         string rv = gui_object_state().get_string (state_id(), property_name);
+               property_hashtable.erase(property_name);
+               property_hashtable.emplace(property_name, rv);
+               return rv;
+       }
 }
 
 bool
@@ -83,7 +91,6 @@ AxisView::set_marked_for_display (bool yn)
                set_gui_property ("visible", yn);
                return true; // things changed
        }
-
        return false;
 }