Fix warnings covered by -Wdelete-non-virtual-dtor
The warnings were:
src/cc/bcc_syms.cc: In function ‘void bcc_free_symcache(void*, int)’:
src/cc/bcc_syms.cc:217:40: warning: deleting object of polymorphic class type ‘KSyms’
which has non-virtual destructor might cause undefined behaviour
[-Wdelete-non-virtual-dtor]
delete static_cast<KSyms*>(symcache);
^
src/cc/bcc_syms.cc:219:43: warning: deleting object of polymorphic class type ‘ProcSyms’
which has non-virtual destructor might cause undefined behaviour
[-Wdelete-non-virtual-dtor]
delete static_cast<ProcSyms*>(symcache);
^
Fix the warnings by defining a virtual destructor for the base class SymbolCache.
Signed-off-by: Marco Leogrande <marcol@plumgrid.com>
Showing
Please register or sign in to comment