From 6694d4f4c0dcdfd169766e533dc17f92e0a38c24 Mon Sep 17 00:00:00 2001 From: Matej Matuska <75834032+matejmatuska@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:11:43 +0200 Subject: [PATCH] Add a virtual destructor to DB_ This removes warning about deleting an object with a non-virtual destructor in the base class. --- convert_db.h | 1 + db.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/convert_db.h b/convert_db.h index 7bc8dfa..2299f41 100644 --- a/convert_db.h +++ b/convert_db.h @@ -39,6 +39,7 @@ class DB_ { virtual bool fill_database(DB_ * old_database); virtual void close_db(); virtual DBC * get_database(); + virtual ~DB_(); }; /* * Libdb class needs only open and read data from libdb database diff --git a/db.cc b/db.cc index 932d517..b0941c7 100644 --- a/db.cc +++ b/db.cc @@ -21,6 +21,10 @@ DBC * DB_::get_database() { return NULL; } void DB_::close_db(){} + +DB_::~DB_() { +} + bool Libdb::connect_database(std::string path){ DB * db; int status;