From: Gildas Bazin Date: Tue, 22 Jul 2003 15:59:06 +0000 (+0000) Subject: * src/misc/variables.c: fixed small mem leak (courtesy of Andy Lindsay) X-Git-Tag: 0.6.1~69 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9a825a723d24c0bc378f2bf8f03cf6690af883ec;p=vlc * src/misc/variables.c: fixed small mem leak (courtesy of Andy Lindsay) * modules/gui/wxwindows/interface.cpp: small improvements to the volume control. --- diff --git a/modules/gui/wxwindows/interface.cpp b/modules/gui/wxwindows/interface.cpp index e9535567e0..d2cc37cf0b 100644 --- a/modules/gui/wxwindows/interface.cpp +++ b/modules/gui/wxwindows/interface.cpp @@ -2,7 +2,7 @@ * interface.cpp : wxWindows plugin for vlc ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: interface.cpp,v 1.51 2003/07/20 20:33:17 gbazin Exp $ + * $Id: interface.cpp,v 1.52 2003/07/22 15:59:06 gbazin Exp $ * * Authors: Gildas Bazin * @@ -113,6 +113,7 @@ private: BEGIN_EVENT_TABLE(wxVolCtrl, wxWindow) /* Mouse events */ EVT_LEFT_DOWN(wxVolCtrl::OnChange) + EVT_MOTION(wxVolCtrl::OnChange) END_EVENT_TABLE() /***************************************************************************** @@ -853,7 +854,10 @@ wxVolCtrl::wxVolCtrl( intf_thread_t *_p_intf, wxWindow* parent, wxWindowID id ) void wxVolCtrl::OnChange( wxMouseEvent& event ) { - int i_volume = (GetRect().height - event.GetY()) * 200 / GetRect().height; + if( !event.LeftDown() && !event.LeftIsDown() ) return; + + int i_volume = (GetClientSize().GetHeight() - event.GetY()) * 200 / + GetClientSize().GetHeight(); Change( i_volume ); } diff --git a/src/misc/variables.c b/src/misc/variables.c index 5ee9d2d59a..7f2e46a0db 100644 --- a/src/misc/variables.c +++ b/src/misc/variables.c @@ -2,7 +2,7 @@ * variables.c: routines for object variables handling ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: variables.c,v 1.26 2003/05/25 11:31:54 gbazin Exp $ + * $Id: variables.c,v 1.27 2003/07/22 15:59:06 gbazin Exp $ * * Authors: Samuel Hocevar * @@ -304,8 +304,11 @@ int __var_Destroy( vlc_object_t *p_this, const char *psz_name ) for( i = 0 ; i < p_var->choices.i_count ; i++ ) { p_var->pf_free( &p_var->choices.p_values[i] ); + if( p_var->choices_text.p_values[i].psz_string ) + free( p_var->choices_text.p_values[i].psz_string ); } free( p_var->choices.p_values ); + free( p_var->choices_text.p_values ); } /* Free callbacks if needed */