summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/editor_component.cc2
-rw-r--r--gtk2_ardour/editor_summary.cc12
2 files changed, 10 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_component.cc b/gtk2_ardour/editor_component.cc
index e45b8f61ef..e78f7804f1 100644
--- a/gtk2_ardour/editor_component.cc
+++ b/gtk2_ardour/editor_component.cc
@@ -45,4 +45,6 @@ EditorComponent::session_going_away ()
for (list<connection>::iterator i = _session_connections.begin(); i != _session_connections.end(); ++i) {
i->disconnect ();
}
+
+ _session = 0;
}
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc
index a9cc524b15..5f3791ba47 100644
--- a/gtk2_ardour/editor_summary.cc
+++ b/gtk2_ardour/editor_summary.cc
@@ -73,6 +73,10 @@ EditorSummary::on_expose_event (GdkEventExpose* event)
{
CairoWidget::on_expose_event (event);
+ if (_session == 0) {
+ return false;
+ }
+
cairo_t* cr = gdk_cairo_create (get_window()->gobj());
/* Render the view rectangle */
@@ -115,16 +119,16 @@ EditorSummary::on_expose_event (GdkEventExpose* event)
void
EditorSummary::render (cairo_t* cr)
{
- if (_session == 0) {
- return;
- }
-
/* background */
cairo_set_source_rgb (cr, 0, 0, 0);
cairo_rectangle (cr, 0, 0, _width, _height);
cairo_fill (cr);
+ if (_session == 0) {
+ return;
+ }
+
/* compute total height of all tracks */
int h = 0;