summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-07-04 11:51:25 +0000
committerCarl Hetherington <carl@carlh.net>2009-07-04 11:51:25 +0000
commit12bf437c6eb6677f10ef7d09b1e096cf67ed73b1 (patch)
tree2f860b6348c410bae313803886b9bf2f06d4b68d /gtk2_ardour
parent30eafbef5ed509a105956d62f093f81eea9e69f1 (diff)
Fixes for crashes on session going away.
git-svn-id: svn://localhost/ardour2/branches/3.0@5317 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-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;