int jni_DestroyGlobals(JNIEnv *env) { destroy_GlobalScreen(env); destroy_NativeHookThread(env); destroy_NativeHookException(env); destroy_NativeMonitorInfo(env); destroy_NativeInputEvent(env); destroy_NativeKeyEvent(env); destroy_NativeMouseEvent(env); destroy_NativeMouseWheelEvent(env); destroy_Object(env); destroy_Integer(env); destroy_System(env); destroy_Logger(env); return JNI_OK; }
void destroy(Object *obj){ if (strcmp(obj->name, "object") == 0){ destroy_Object(obj); } else if (strcmp(obj->name, "integer") == 0){ destroy_Integer(obj); } else if (strcmp(obj->name, "list") == 0){ destroy_List(obj); } else if (strcmp(obj->name, "string") == 0){ destroy_List(obj); } else if (strcmp(obj->name, "char") == 0){ destroy_Char(obj); } else { free(obj); } }