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:
parent
84409dfa0a
commit
b021c3c938
1 changed files with 2 additions and 4 deletions
|
|
@ -118,7 +118,6 @@ protected:
|
|||
if ( pobj )
|
||||
{
|
||||
// Add ourselves to object tracker list
|
||||
wxASSERT( ptbase );
|
||||
ptbase->AddNode( this );
|
||||
m_pobj = pobj;
|
||||
m_ptbase = ptbase;
|
||||
|
|
@ -153,8 +152,8 @@ public:
|
|||
virtual ~wxWeakRefDynamic() { Release(); }
|
||||
|
||||
// Smart pointer functions
|
||||
T& operator*() const { wxASSERT(m_pobj); return *m_pobj; }
|
||||
T* operator->() const { wxASSERT(m_pobj); return m_pobj; }
|
||||
T& operator*() const { return *m_pobj; }
|
||||
T* operator->() const { return m_pobj; }
|
||||
|
||||
T* get() const { return m_pobj; }
|
||||
operator T* () const { return m_pobj; }
|
||||
|
|
@ -171,7 +170,6 @@ public:
|
|||
{
|
||||
// Remove ourselves from object tracker list
|
||||
wxTrackable *pt = dynamic_cast<wxTrackable*>(m_pobj);
|
||||
wxASSERT(pt);
|
||||
pt->RemoveNode(this);
|
||||
m_pobj = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue