Bläddra i källkod

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

gifur 5 år sedan
förälder
incheckning
14860373fb
1 ändrade filer med 2 tillägg och 2 borttagningar
  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; }