13
0

fix crash when ArdourButton has its text set to empty

git-svn-id: svn://localhost/ardour2/branches/3.0@10414 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-11-03 14:51:23 +00:00
parent d555253fff
commit 1262e9ef58

View File

@ -81,8 +81,10 @@ ArdourButton::set_text (const std::string& str)
if (!_layout && !_text.empty()) { if (!_layout && !_text.empty()) {
_layout = Pango::Layout::create (get_pango_context()); _layout = Pango::Layout::create (get_pango_context());
} }
_layout->set_text (str); if (_layout) {
_layout->set_text (str);
}
queue_resize (); queue_resize ();
} }
@ -559,3 +561,4 @@ ArdourButton::set_image (const RefPtr<Gdk::Pixbuf>& img)
_pixbuf = img; _pixbuf = img;
queue_draw (); queue_draw ();
} }