summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/fastmeter.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-07-31 19:24:26 +0200
committerRobin Gareus <robin@gareus.org>2013-07-31 19:29:20 +0200
commit7a02d9e08d36407956aaedf2142f692f1857a330 (patch)
treec8fa483d127ff0bb5edb3d98be957cf62183fae9 /libs/gtkmm2ext/fastmeter.cc
parentc7fcba77b8573e021b58bb502f229d84756ec86b (diff)
clean up some valgrid "Uninitialised value was created by a heap allocation" wanings
Diffstat (limited to 'libs/gtkmm2ext/fastmeter.cc')
-rw-r--r--libs/gtkmm2ext/fastmeter.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/libs/gtkmm2ext/fastmeter.cc b/libs/gtkmm2ext/fastmeter.cc
index 022962a7e1..d826def7ff 100644
--- a/libs/gtkmm2ext/fastmeter.cc
+++ b/libs/gtkmm2ext/fastmeter.cc
@@ -57,17 +57,22 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
float stp2, float stp3,
int styleflags
)
+ : pixheight(0)
+ , pixwidth(0)
+ , _styleflags(styleflags)
+ , orientation(o)
+ , hold_cnt(hold)
+ , hold_state(0)
+ , bright_hold(false)
+ , current_level(0)
+ , current_peak(0)
+ , highlight(false)
{
- orientation = o;
- hold_cnt = hold;
- hold_state = 0;
- bright_hold = false;
- current_peak = 0;
- current_level = 0;
last_peak_rect.width = 0;
last_peak_rect.height = 0;
+ last_peak_rect.x = 0;
+ last_peak_rect.y = 0;
- highlight = false;
no_rgba_overlay = ! Glib::getenv("NO_METER_SHADE").empty();
_clr[0] = clr0;
@@ -92,8 +97,6 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
_stp[2] = stp2;
_stp[3] = stp3;
- _styleflags = styleflags;
-
set_events (BUTTON_PRESS_MASK|BUTTON_RELEASE_MASK);
pixrect.x = 1;
@@ -690,6 +693,8 @@ FastMeter::set (float lvl, float peak)
float old_level = current_level;
float old_peak = current_peak;
+ if (pixwidth <= 0 || pixheight <=0) return;
+
if (peak == -1) {
if (lvl >= current_peak) {
current_peak = lvl;