g_free(m->path);
}
-/* called every time the user presses "Apply" or "OK in the list of
- * GeoIP directories, and also once on startup */
-static void geoip_db_post_update_cb(void) {
+static void geoip_dat_cleanup(void) {
GeoIP *gi;
guint i;
}
/* finally, free the array itself */
g_array_free(geoip_dat_arr, TRUE);
+ geoip_dat_arr = NULL;
}
+}
+
+/* called every time the user presses "Apply" or "OK in the list of
+ * GeoIP directories, and also once on startup */
+static void geoip_db_post_update_cb(void) {
+ guint i;
+ GeoIP* gi;
+
+ geoip_dat_cleanup();
/* allocate the array */
geoip_dat_arr = g_array_new(FALSE, FALSE, sizeof(GeoIP *));
g_array_append_val(geoip_dat_arr, gi);
}
+static void geoip_db_cleanup(void)
+{
+ geoip_dat_cleanup();
+}
+
/**
* Initialize GeoIP lookups
*/
NULL,
geoip_db_path_free_cb,
geoip_db_post_update_cb,
+ geoip_db_cleanup,
geoip_db_paths_fields);
prefs_register_uat_preference(nameres,