@@ -60,22 +60,21 @@ void Initialize(const App& app) {
60
60
61
61
#if defined(_WIN32)
62
62
if (!g_analytics_module) {
63
- g_analytics_module = firebase::analytics::internal::VerifyAndLoadAnalyticsLibrary (
64
- ANALYTICS_DLL_FILENAME,
65
- FirebaseAnalytics_WindowsDllHash,
66
- sizeof (FirebaseAnalytics_WindowsDllHash));
63
+ g_analytics_module =
64
+ firebase::analytics::internal::VerifyAndLoadAnalyticsLibrary (
65
+ ANALYTICS_DLL_FILENAME, FirebaseAnalytics_WindowsDllHash,
66
+ sizeof (FirebaseAnalytics_WindowsDllHash));
67
67
68
68
if (g_analytics_module) {
69
- LogInfo (" Loaded Google Analytics module securely." );
70
- int num_loaded = FirebaseAnalytics_LoadDynamicFunctions (g_analytics_module); // Ensure g_analytics_module is used
69
+ LogInfo (" Loaded Google Analytics module." );
70
+ int num_loaded = FirebaseAnalytics_LoadDynamicFunctions (
71
+ g_analytics_module); // Ensure g_analytics_module is used
71
72
if (num_loaded < FIREBASE_ANALYTICS_DYNAMIC_FUNCTION_COUNT) {
72
73
LogWarning (
73
74
" Only loaded %d out of %d expected functions from the Google "
74
75
" Analytics module." ,
75
76
num_loaded, FIREBASE_ANALYTICS_DYNAMIC_FUNCTION_COUNT);
76
77
}
77
- } else {
78
- LogError (" Failed to load Google Analytics module securely. Operating in stub mode." );
79
78
}
80
79
}
81
80
#endif
@@ -92,21 +91,24 @@ bool IsInitialized() { return g_initialized; }
92
91
// Call this function when Analytics is no longer needed to free up resources.
93
92
void Terminate () {
94
93
#if defined(_WIN32)
95
- // FirebaseAnalytics_UnloadDynamicFunctions(); // This should be called by the dynamic functions manager if needed
96
- // or handled by the loaded module itself upon unload.
97
- // If FirebaseAnalytics_UnloadDynamicFunctions clears function pointers,
98
- // it's okay, but typically not called directly before FreeLibrary
99
- // unless it's managing internal state that needs reset.
100
- // For now, assuming FreeLibrary is sufficient for module cleanup.
94
+ // FirebaseAnalytics_UnloadDynamicFunctions(); // This should be called by the
95
+ // dynamic functions manager if needed or handled by the loaded module itself
96
+ // upon unload. If FirebaseAnalytics_UnloadDynamicFunctions clears function
97
+ // pointers, it's okay, but typically not called directly before FreeLibrary
98
+ // unless it's managing internal state that needs reset.
99
+ // For now, assuming FreeLibrary is sufficient for module cleanup.
101
100
if (g_analytics_module) {
102
- // Before freeing the library, ensure any dynamic functions are cleared if necessary,
103
- // though FirebaseAnalytics_LoadDynamicFunctions is usually paired with an unload at a higher level
104
- // or the dynamic function pointers are simply nulled out.
105
- // FirebaseAnalytics_UnloadDynamicFunctions(); // Re-evaluating placement, typically called if functions are globally stored.
106
- // If they are member of a class, destructor handles it.
107
- // Given it's C-style, it might clear global pointers.
108
- // This is generally okay to call before FreeLibrary.
109
- FirebaseAnalytics_UnloadDynamicFunctions (); // Explicitly clear function pointers from dynamic loading.
101
+ // Before freeing the library, ensure any dynamic functions are cleared if
102
+ // necessary, though FirebaseAnalytics_LoadDynamicFunctions is usually
103
+ // paired with an unload at a higher level or the dynamic function pointers
104
+ // are simply nulled out. FirebaseAnalytics_UnloadDynamicFunctions(); //
105
+ // Re-evaluating placement, typically called if functions are globally
106
+ // stored. If they are member of a class, destructor handles it. Given it's
107
+ // C-style, it might clear global pointers. This is generally okay to call
108
+ // before FreeLibrary.
109
+ FirebaseAnalytics_UnloadDynamicFunctions (); // Explicitly clear function
110
+ // pointers from dynamic
111
+ // loading.
110
112
FreeLibrary (g_analytics_module);
111
113
g_analytics_module = 0 ;
112
114
}
0 commit comments