1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-08 11:33:42 +00:00

Added gaurd, to abort dispatch if the HECI object was GC'ed.

This commit is contained in:
Bryan Roe
2019-10-28 11:31:16 -07:00
parent 5476ad8b5f
commit 823b688537

View File

@@ -768,6 +768,8 @@ void ILibDuktape_HECI_IoctlHandler_Dispatch(void *chain, void *user)
int i; int i;
duk_context *ctx = data->ctx; duk_context *ctx = data->ctx;
if (!ILibMemory_CanaryOK(data)) { return; } // Abort Dispatch, becuase the HECI object was GC'ed.
duk_push_heapptr(data->ctx, data->data); // [array] duk_push_heapptr(data->ctx, data->data); // [array]
duk_push_heapptr(data->ctx, data->heciObject); // [array][heci] duk_push_heapptr(data->ctx, data->heciObject); // [array][heci]
duk_get_prop_index(data->ctx, -2, 2); // [array][heci][callback] duk_get_prop_index(data->ctx, -2, 2); // [array][heci][callback]