Explorar o código

Z991239-632 #comment fix: CEntityBase 析构函数 delete 前做判断

gifur %!s(int64=5) %!d(string=hai) anos
pai
achega
14860373fb
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Common/SpBase.h

+ 2 - 2
Common/SpBase.h

@@ -974,8 +974,8 @@ struct ITransactionContext
 class CEntityBase
 {
 public:
-	CEntityBase():m_pEntityFunction(NULL) {}
-	virtual ~CEntityBase() { delete m_pEntityFunction; }
+	CEntityBase():m_pEntityFunction(nullptr) {}
+	virtual ~CEntityBase() { if(m_pEntityFunction != nullptr) delete m_pEntityFunction; }
 
 	/** get entity service function */
 	CSmartPointer<IEntityFunction> GetFunction() { return m_pEntityFunction; }