mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-20 02:03:15 +00:00
Fixed crash on self-update, caused by IOActive fix on posix
This commit is contained in:
@@ -765,6 +765,12 @@ void Duktape_SafeDestroyHeap(duk_context *ctx)
|
|||||||
|
|
||||||
duk_destroy_heap(ctx);
|
duk_destroy_heap(ctx);
|
||||||
|
|
||||||
|
if (ctxd->fakechain != 0 && ctxd->chain != NULL)
|
||||||
|
{
|
||||||
|
ILibChain_DestroyEx(ctxd->chain);
|
||||||
|
ctxd->chain = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (ILibLinkedList_GetCount(ctxd->threads) > 0)
|
if (ILibLinkedList_GetCount(ctxd->threads) > 0)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -797,6 +803,7 @@ void Duktape_SafeDestroyHeap(duk_context *ctx)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ILibLinkedList_Destroy(ctxd->threads);
|
ILibLinkedList_Destroy(ctxd->threads);
|
||||||
|
|
||||||
ILibMemory_Free(ctxd);
|
ILibMemory_Free(ctxd);
|
||||||
}
|
}
|
||||||
void *Duktape_GetChain(duk_context *ctx)
|
void *Duktape_GetChain(duk_context *ctx)
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ typedef struct ILibDuktape_ContextData
|
|||||||
uint32_t apc_flags;
|
uint32_t apc_flags;
|
||||||
#endif
|
#endif
|
||||||
void *threads;
|
void *threads;
|
||||||
|
int fakechain;
|
||||||
void *chain;
|
void *chain;
|
||||||
void *user;
|
void *user;
|
||||||
}ILibDuktape_ContextData;
|
}ILibDuktape_ContextData;
|
||||||
|
|||||||
@@ -2514,6 +2514,11 @@ int ILibDuktape_ScriptContainer_DebuggingOK(duk_context *ctx)
|
|||||||
duk_context *ILibDuktape_ScriptContainer_InitializeJavaScriptEngineEx3(duk_context *ctx, SCRIPT_ENGINE_SECURITY_FLAGS securityFlags, unsigned int executionTimeout, void *chain, char **argList, ILibSimpleDataStore *db, char *exePath, ILibProcessPipe_Manager pipeManager, ILibDuktape_HelperEvent exitHandler, void *exitUser)
|
duk_context *ILibDuktape_ScriptContainer_InitializeJavaScriptEngineEx3(duk_context *ctx, SCRIPT_ENGINE_SECURITY_FLAGS securityFlags, unsigned int executionTimeout, void *chain, char **argList, ILibSimpleDataStore *db, char *exePath, ILibProcessPipe_Manager pipeManager, ILibDuktape_HelperEvent exitHandler, void *exitUser)
|
||||||
{
|
{
|
||||||
void **timeoutKey = executionTimeout > 0 ? (void**)ILibMemory_Allocate(sizeof(void*), 0, NULL, NULL) : NULL;
|
void **timeoutKey = executionTimeout > 0 ? (void**)ILibMemory_Allocate(sizeof(void*), 0, NULL, NULL) : NULL;
|
||||||
|
if (chain == NULL)
|
||||||
|
{
|
||||||
|
duk_ctx_context_data(ctx)->fakechain = 1;
|
||||||
|
chain = ILibCreateChain();
|
||||||
|
}
|
||||||
duk_ctx_context_data(ctx)->chain = chain;
|
duk_ctx_context_data(ctx)->chain = chain;
|
||||||
|
|
||||||
duk_push_heap_stash(ctx); // [s]
|
duk_push_heap_stash(ctx); // [s]
|
||||||
|
|||||||
Reference in New Issue
Block a user