Commit 9a825a72 authored by gbazin's avatar gbazin
Browse files

* src/misc/variables.c: fixed small mem leak (courtesy of Andy Lindsay)

* modules/gui/wxwindows/interface.cpp: small improvements to the volume control.
parent e6063e73
......@@ -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 <gbazin@netcourrier.com>
*
......@@ -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 );
}
......
......@@ -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 <sam@zoy.org>
*
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment