diff --git a/dlls/geoip/geoip_amxx.cpp b/dlls/geoip/geoip_amxx.cpp index 9674d625..99534cf5 100755 --- a/dlls/geoip/geoip_amxx.cpp +++ b/dlls/geoip/geoip_amxx.cpp @@ -39,9 +39,15 @@ void OnAmxxAttach() MF_AddNatives(geoip_natives); } +void OnAmxxDetach() +{ + GeoIP_delete(gi); + gi = NULL; +} + AMX_NATIVE_INFO geoip_natives[] = { {"geoip_code2", amx_geoip_code2}, {"geoip_code3", amx_geoip_code3}, {"geoip_country", amx_geoip_country}, {NULL, NULL}, -}; \ No newline at end of file +}; diff --git a/dlls/geoip/moduleconfig.h b/dlls/geoip/moduleconfig.h index db0b998f..8427b667 100755 --- a/dlls/geoip/moduleconfig.h +++ b/dlls/geoip/moduleconfig.h @@ -10,7 +10,7 @@ #define MODULE_URL "http://www.bailopan.com/" #define MODULE_LOGTAG "GEOIP" // If you want the module not to be reloaded on mapchange, remove / comment out the next line -#define MODULE_RELOAD_ON_MAPCHANGE +//#define MODULE_RELOAD_ON_MAPCHANGE #ifdef __DATE__ #define MODULE_DATE __DATE__ @@ -29,7 +29,7 @@ // Do native functions init here (MF_AddNatives) #define FN_AMXX_ATTACH OnAmxxAttach // AMXX dettach -//#define FN_AMXX_DETTACH OnAmxxDettach +#define FN_AMXX_DETTACH OnAmxxDettach // All plugins loaded // Do forward functions init here (MF_RegisterForward) // #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded