Skip to content

Commit 5fa50c1

Browse files
committed
Revert to stubs on load fail.
1 parent 2a90735 commit 5fa50c1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

analytics/src/analytics_desktop.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,18 @@ void Initialize(const App& app) {
6666
sizeof(FirebaseAnalytics_WindowsDllHash));
6767

6868
if (g_analytics_module) {
69-
LogInfo("Loaded Google Analytics module.");
7069
int num_loaded = FirebaseAnalytics_LoadDynamicFunctions(
7170
g_analytics_module); // Ensure g_analytics_module is used
7271
if (num_loaded < FIREBASE_ANALYTICS_DYNAMIC_FUNCTION_COUNT) {
7372
LogWarning(
74-
"Only loaded %d out of %d expected functions from the Google "
75-
"Analytics module.",
73+
"Analytics: Failed to load functions from Google Analytics "
74+
"module (%d out of %d loaded), reverting to stubs.",
7675
num_loaded, FIREBASE_ANALYTICS_DYNAMIC_FUNCTION_COUNT);
76+
FirebaseAnalytics_UnloadDynamicFunctions();
77+
FreeLibrary(g_analytics_module);
78+
g_analytics_module = 0;
79+
} else {
80+
LogInfo("Analytics: Loaded Google Analytics module.");
7781
}
7882
}
7983
}

0 commit comments

Comments
 (0)