fix PIKA_EVENT_ENABLE

This commit is contained in:
lyon 2022-11-05 16:18:11 +08:00
parent 9294c45feb
commit 2d7592a665
3 changed files with 9 additions and 1 deletions

View File

@ -128,7 +128,9 @@ int32_t obj_deinit(PikaObj* self) {
void _mem_cache_deinit(void);
void VMSignal_deinit(void);
_mem_cache_deinit();
#if PIKA_EVENT_ENABLE
VMSignal_deinit();
#endif
}
return obj_deinit_no_del(self);
}

View File

@ -63,12 +63,18 @@ static PIKA_BOOL _cq_isFull(volatile EventCQ* cq) {
#endif
void VMSignal_deinit(void) {
#if !PIKA_EVENT_ENABLE
__platform_printf("PIKA_EVENT_ENABLE is not enable");
while (1) {
};
#else
for (int i = 0; i < PIKA_EVENT_LIST_SIZE; i++) {
if (NULL != PikaVMSignal.cq.res[i]) {
arg_deinit(PikaVMSignal.cq.res[i]);
PikaVMSignal.cq.res[i] = NULL;
}
}
#endif
}
PIKA_RES VMSignal_pushEvent(PikaEventListener* lisener,

View File

@ -2,4 +2,4 @@
#define PIKA_VERSION_MINOR 11
#define PIKA_VERSION_MICRO 6
#define PIKA_EDIT_TIME "2022/11/02 12:44:46"
#define PIKA_EDIT_TIME "2022/11/05 16:18:10"