diff --git a/common/include/Utilities/SafeArray.h b/common/include/Utilities/SafeArray.h index 8c9c405293..4df00cddc0 100644 --- a/common/include/Utilities/SafeArray.h +++ b/common/include/Utilities/SafeArray.h @@ -227,7 +227,7 @@ protected: public: using _parent::operator[]; - virtual ~SafeAlignedArray(); + virtual ~SafeAlignedArray() throw(); explicit SafeAlignedArray( const wxChar* name=L"Unnamed" ) : SafeArray::SafeArray( name ) diff --git a/common/include/Utilities/SafeArray.inl b/common/include/Utilities/SafeArray.inl index 6392a25fa3..bae14e6f16 100644 --- a/common/include/Utilities/SafeArray.inl +++ b/common/include/Utilities/SafeArray.inl @@ -62,7 +62,7 @@ SafeArray::~SafeArray() throw() } template< typename T > -SafeArray::SafeArray( const wxChar* name=L"Unnamed" ) +SafeArray::SafeArray( const wxChar* name ) : Name( name ) { ChunkSize = DefaultChunkSize; @@ -71,7 +71,7 @@ SafeArray::SafeArray( const wxChar* name=L"Unnamed" ) } template< typename T > -SafeArray::SafeArray( int initialSize, const wxChar* name=L"Unnamed" ) +SafeArray::SafeArray( int initialSize, const wxChar* name ) : Name( name ) { ChunkSize = DefaultChunkSize; @@ -132,14 +132,14 @@ T* SafeAlignedArray::_virtual_realloc( int newsize ) // Maybe useful,maybe not... no harm in attaching it. :D template< typename T, uint Alignment > -SafeAlignedArray::~SafeAlignedArray() +SafeAlignedArray::~SafeAlignedArray() throw() { safe_aligned_free( this->m_ptr ); // mptr is set to null, so the parent class's destructor won't re-free it. } template< typename T, uint Alignment > -SafeAlignedArray::SafeAlignedArray( int initialSize, const wxChar* name=L"Unnamed" ) : +SafeAlignedArray::SafeAlignedArray( int initialSize, const wxChar* name ) : SafeArray::SafeArray( name, (T*)_aligned_malloc( initialSize * sizeof(T), Alignment ), @@ -173,7 +173,7 @@ SafeList::~SafeList() throw() } template< typename T > -SafeList::SafeList( const wxChar* name=L"Unnamed" ) +SafeList::SafeList( const wxChar* name ) : Name( name ) { ChunkSize = DefaultChunkSize; @@ -183,7 +183,7 @@ SafeList::SafeList( const wxChar* name=L"Unnamed" ) } template< typename T > -SafeList::SafeList( int initialSize, const wxChar* name=L"Unnamed" ) +SafeList::SafeList( int initialSize, const wxChar* name ) : Name( name ) { ChunkSize = DefaultChunkSize; diff --git a/common/include/Utilities/TlsVariable.inl b/common/include/Utilities/TlsVariable.inl index 9840d4f4ea..3521a8e66d 100644 --- a/common/include/Utilities/TlsVariable.inl +++ b/common/include/Utilities/TlsVariable.inl @@ -87,7 +87,6 @@ protected: } }; - template< typename T > class TlsVariable : public BaseTlsVariable { @@ -95,6 +94,7 @@ class TlsVariable : public BaseTlsVariable protected: T m_initval; + bool m_IsDisposed; public: TlsVariable() {} @@ -109,6 +109,9 @@ public: m_IsDisposed = true; } + // This is needed; The C++ standard likes making life suck for programmers. + using BaseTlsVariable::GetRef; + TlsVariable& operator=( const T& src ) { GetRef() = src;