From e7a0fd93e2f67be95d3bd0de8978b9ba350b24c6 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 7 Feb 2009 16:17:38 +0000 Subject: [PATCH] Fix uninitialized string that was causing the deskbar volume control replicant to crash randomly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29150 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/desklink/VolumeSlider.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/desklink/VolumeSlider.cpp b/src/bin/desklink/VolumeSlider.cpp index 4118d3386a..4629fbca8c 100644 --- a/src/bin/desklink/VolumeSlider.cpp +++ b/src/bin/desklink/VolumeSlider.cpp @@ -250,7 +250,7 @@ VolumeSlider::VolumeSlider(BRect frame, bool dontBeep, int32 volumeWhich) float value = 0.0; fDontBeep = dontBeep; - const char *errString; + const char *errString = NULL; fMixerControl = new MixerControl(volumeWhich, &value, &errString); BBox *box = new BBox(Bounds(), "sliderbox", B_FOLLOW_LEFT | B_FOLLOW_TOP, @@ -381,8 +381,7 @@ SliderView::Draw(BRect updateRect) SetHighColor(156,154,156); FillRect(BRect(position,3,192,13)); - BFont font; - float width = font.StringWidth(fTitle); + float width = be_plain_font->StringWidth(fTitle); SetHighColor(49,154,49); DrawString(fTitle, BPoint(11 + (192-11-width)/2, 12));