Explorar el Código

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

gifur hace 5 años
padre
commit
14860373fb
Se han modificado 1 ficheros con 2 adiciones y 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; }