Ticket #6400: libs_libmythupnp-uninit.patch

File libs_libmythupnp-uninit.patch, 1.3 KB (added by Erik Hovland <erik@…>, 15 years ago)

Intialize m_value in StateVariable? ctor

  • mythtv/libs/libmythupnp/eventing.h

    Initialize m_value in StateVariable ctor
    
    From: Erik Hovland <erik@hovland.org>
    
    eventing.h in libmythupnp needs to be initialized in the ctor of
    StateVariable. It is in one ctor, but not the other.
    ---
    
     mythtv/libs/libmythupnp/eventing.h |    5 ++---
     1 files changed, 2 insertions(+), 3 deletions(-)
    
    
    diff --git a/mythtv/libs/libmythupnp/eventing.h b/mythtv/libs/libmythupnp/eventing.h
    index b245f37..0385cda 100644
    a b class StateVariable : public StateVariableBase 
    137137
    138138        // ------------------------------------------------------------------
    139139
    140         StateVariable( const QString &sName, bool bNotify = false ) : StateVariableBase( sName, bNotify )
     140        StateVariable( const QString &sName, bool bNotify = false ) : StateVariableBase( sName, bNotify ), m_value( T( ) )
    141141        {
    142142        }
    143143
    144144        // ------------------------------------------------------------------
    145145
    146         StateVariable( const QString &sName, T value, bool bNotify = false ) : StateVariableBase( sName, bNotify )
     146        StateVariable( const QString &sName, T value, bool bNotify = false ) : StateVariableBase( sName, bNotify ), m_value(value)
    147147        {
    148             m_value = value;
    149148        }
    150149
    151150        // ------------------------------------------------------------------