initialize some uninitialized variables
authorRobin Gareus <robin@gareus.org>
Thu, 31 Mar 2016 21:40:23 +0000 (23:40 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 31 Mar 2016 21:40:23 +0000 (23:40 +0200)
gtk2_ardour/ardour_button.cc

index 2d020595ab63f0e2c24661dc3be8348e08deac87..ccf45c6121b25109782b63dbd12aa2b2ef4dbb7b 100644 (file)
@@ -102,6 +102,9 @@ ArdourButton::ArdourButton (Element e)
 ArdourButton::ArdourButton (const std::string& str, Element e)
        : _elements (e)
        , _tweaks (Tweaks (0))
+       , _char_pixel_width (0)
+       , _char_pixel_height (0)
+       , _char_avg_pixel_width (0)
        , _text_width (0)
        , _text_height (0)
        , _diameter (0)
@@ -538,6 +541,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
        if ((_elements & Text) && !_text.empty()) {
                // if _layout does not exist, char_pixel_height() creates it,
                req->height = std::max(req->height, (int) ceil(char_pixel_height() * BASELINESTRETCH + 1.0));
+               assert (_layout);
                _layout->get_pixel_size (_text_width, _text_height);
                req->width += rint(1.75 * char_pixel_width()); // padding
                req->width += _text_width;