Przeglądaj źródła

fix(cherrymp): fix block size check

Signed-off-by: sakumisu <1203593632@qq.com>
sakumisu 2 tygodni temu
rodzic
commit
1a5bc9d150
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      third_party/cherrymp/chry_mempool.c

+ 2 - 2
third_party/cherrymp/chry_mempool.c

@@ -145,7 +145,7 @@ int chry_mempool_create(struct chry_mempool *pool, void *block, uint32_t block_s
         return -1;
     }
 
-    if (pool->block_size % 4) {
+    if (block_size % 4) {
         return -1;
     }
 
@@ -176,9 +176,9 @@ int chry_mempool_create(struct chry_mempool *pool, void *block, uint32_t block_s
 
 void chry_mempool_delete(struct chry_mempool *pool)
 {
-    chry_mempool_osal_sem_delete(pool->out_sem);
     __chry_ringbuffer_reset(&pool->in);
     __chry_ringbuffer_reset(&pool->out);
+    chry_mempool_osal_sem_delete(pool->out_sem);
 }
 
 uintptr_t *chry_mempool_alloc(struct chry_mempool *pool)