Don't try to copy from a null source

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@716 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2006-03-26 20:45:27 +00:00
parent 61a07301a1
commit d6aab01b08
+5
View File
@@ -502,6 +502,11 @@ public:
CSmartPtr<T>& operator =(const CSmartPtr<T>& CopyFrom) {
if (&CopyFrom != this) { // Check for assignment to self
Release(); // Release the current pointer
if (CopyFrom.IsNull()) { // If the source raw pointer is null
return *this; // Then just bail out
}
m_pType = &(*CopyFrom); // Make our pointers reference the same raw pointer and counter
m_puCount = CopyFrom.GetCount();