Destructors for C++ Interface-like classes

前端 未结 6 959
甜味超标
甜味超标 2020-12-30 23:20

Starting to use PC-Lint on an existing code base (fear and trepidation).

One thing that it complains about is the following:

 class IBatch
 {
 public         


        
6条回答
  •  既然无缘
    2020-12-31 00:21

    Compiler puts default destructor that is not virtual, which implies that a 'delete' on a pointer to the virtual base class will succeed with a resulting memory leak. Therefore, it is an implementation flaw, neither style or coding error.

提交回复
热议问题