Remove useless asserts from wxWeakRef implementation
No real changes, just remove asserts verifying that a pointer is non-null right before dereferencing it, as they're perfectly useless for all the usual reasons and just add extra code to relatively often used functions.
This commit is contained in:
@@ -118,7 +118,6 @@ protected:
|
|||||||
if ( pobj )
|
if ( pobj )
|
||||||
{
|
{
|
||||||
// Add ourselves to object tracker list
|
// Add ourselves to object tracker list
|
||||||
wxASSERT( ptbase );
|
|
||||||
ptbase->AddNode( this );
|
ptbase->AddNode( this );
|
||||||
m_pobj = pobj;
|
m_pobj = pobj;
|
||||||
m_ptbase = ptbase;
|
m_ptbase = ptbase;
|
||||||
@@ -153,8 +152,8 @@ public:
|
|||||||
virtual ~wxWeakRefDynamic() { Release(); }
|
virtual ~wxWeakRefDynamic() { Release(); }
|
||||||
|
|
||||||
// Smart pointer functions
|
// Smart pointer functions
|
||||||
T& operator*() const { wxASSERT(m_pobj); return *m_pobj; }
|
T& operator*() const { return *m_pobj; }
|
||||||
T* operator->() const { wxASSERT(m_pobj); return m_pobj; }
|
T* operator->() const { return m_pobj; }
|
||||||
|
|
||||||
T* get() const { return m_pobj; }
|
T* get() const { return m_pobj; }
|
||||||
operator T* () const { return m_pobj; }
|
operator T* () const { return m_pobj; }
|
||||||
@@ -171,7 +170,6 @@ public:
|
|||||||
{
|
{
|
||||||
// Remove ourselves from object tracker list
|
// Remove ourselves from object tracker list
|
||||||
wxTrackable *pt = dynamic_cast<wxTrackable*>(m_pobj);
|
wxTrackable *pt = dynamic_cast<wxTrackable*>(m_pobj);
|
||||||
wxASSERT(pt);
|
|
||||||
pt->RemoveNode(this);
|
pt->RemoveNode(this);
|
||||||
m_pobj = NULL;
|
m_pobj = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user