Do you have this plugin above ttt_core.amxx in plugins.ini? If so, you should put your plugin after ttt_core.amxx. This way, the plugin_end() function in ttt_core.amxx which causes the execution of ttt_gamemode(GAME_PREPARING) before the array is destroyed in plugin_end() of your plugin.
I can't think of any other reason this would be happening. Alternatively, or in addition to, you should probably check that g_aSetup is valid before calling ArrayClear(g_aSetup).