cell destroyParser(cell *handle) { ParseInfo *p = TextParsersHandles.lookup(*handle); if (!p) { return 0; } if (TextParsersHandles.destroy(*handle)) { *handle = 0; return 1; } return 0; }
//native TrieSnapshotDestroy(&Snapshot:handle) static cell AMX_NATIVE_CALL TrieSnapshotDestroy(AMX *amx, cell *params) { cell *ptr = get_amxaddr(amx, params[1]); TrieSnapshot *t = TrieSnapshotHandles.lookup(*ptr); if (!t) { return 0; } if (TrieSnapshotHandles.destroy(*ptr)) { *ptr = 0; return 1; } return 0; }
// native ArrayDestroy(&Array:which); static cell AMX_NATIVE_CALL ArrayDestroy(AMX* amx, cell* params) { cell *handle = get_amxaddr(amx, params[1]); CellArray* vec = ArrayHandles.lookup(*handle); if (!vec) { return 0; } if (ArrayHandles.destroy(*handle)) { *handle = 0; return 1; } return 1; }
// native CloseGameConfigFile(&GameConfig:handle); static cell AMX_NATIVE_CALL CloseGameConfigFile(AMX *amx, cell *params) { cell *address = get_amxaddr(amx, params[1]); GameConfigNative *handle = GameConfigHandle.lookup(*address); if (!handle) { return 0; } if (GameConfigHandle.destroy(*address)) { *address = 0; return 1; } return 0; }