Skip to content

Commit 28f44de

Browse files
authored
Add missing virtual destructors for App Check (#1099)
1 parent c621a5d commit 28f44de

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app_check/src/common/app_check.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ DEFINE_FIREBASE_VERSION_STRING(FirebaseAppCheck);
5252
Mutex g_app_check_lock; // NOLINT
5353
static std::map<::firebase::App*, AppCheck*>* g_app_check_map = nullptr;
5454

55+
// Define the destructors for the virtual listener/provider/factory classes.
56+
AppCheckListener::~AppCheckListener() {}
57+
AppCheckProvider::~AppCheckProvider() {}
58+
AppCheckProviderFactory::~AppCheckProviderFactory() {}
59+
5560
AppCheck* AppCheck::GetInstance(::firebase::App* app) {
5661
MutexLock lock(g_app_check_lock);
5762
if (!g_app_check_map) {

app_check/src/include/firebase/app_check.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct AppCheckToken {
5858

5959
/// @brief Base class used to receive messages when AppCheck token changes.
6060
class AppCheckListener {
61-
virtual ~AppCheckListener();
61+
virtual ~AppCheckListener() = 0;
6262
/// This method gets invoked on the UI thread on changes to the token state.
6363
/// Does not trigger on token expiry.
6464
virtual void OnAppCheckTokenChanged(const AppCheckToken& token) = 0;
@@ -71,7 +71,7 @@ class AppCheckListener {
7171
/// call and returning that new token if it can.
7272
class AppCheckProvider {
7373
public:
74-
virtual ~AppCheckProvider();
74+
virtual ~AppCheckProvider() = 0;
7575
/// Fetches an AppCheckToken and then calls the provided callback method with
7676
/// the token or with an error code and error message.
7777
virtual void GetToken(
@@ -82,7 +82,7 @@ class AppCheckProvider {
8282
/// Interface for a factory that generates {@link AppCheckProvider}s.
8383
class AppCheckProviderFactory {
8484
public:
85-
virtual ~AppCheckProviderFactory();
85+
virtual ~AppCheckProviderFactory() = 0;
8686
/// Gets the {@link AppCheckProvider} associated with the given
8787
/// {@link App} instance, or creates one if none
8888
/// already exists.

0 commit comments

Comments
 (0)