From f6c254bd4ce19dc6262d26bd434801ea51100eca Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Tue, 19 May 2020 15:53:59 -0700 Subject: [PATCH] Fixed crash caused by ChainViewer --- microscript/ILibDuktape_Polyfills.c | 1 + microstack/ILibParsers.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/microscript/ILibDuktape_Polyfills.c b/microscript/ILibDuktape_Polyfills.c index e33343d..073f01c 100644 --- a/microscript/ILibDuktape_Polyfills.c +++ b/microscript/ILibDuktape_Polyfills.c @@ -2275,6 +2275,7 @@ void ILibDuktape_ChainViewer_PostSelect(void* object, int slct, fd_set *readset, duk_swap_top(ctx, -2); // [this][list][RES][this] duk_push_string(ctx, m); // [this][list][RES][this][str] duk_pcall_method(ctx, 1); duk_pop(ctx); // [this][list] + ILibMemory_Free(m); } duk_set_top(ctx, top); diff --git a/microstack/ILibParsers.c b/microstack/ILibParsers.c index dbbe26c..7a9d658 100644 --- a/microstack/ILibParsers.c +++ b/microstack/ILibParsers.c @@ -1893,9 +1893,9 @@ void ILibAddToChain(void *Chain, void *object) void ILibPrependToChain(void *Chain, void *object) { // - // Add link to the front of the chain (Linked List) + // Add link to the front of the chain (Linked List), right after the Timer // - ILibLinkedList_AddHead(((ILibBaseChain*)Chain)->Links, object); + ILibLinkedList_InsertAfter(ILibLinkedList_GetNode_Head(((ILibBaseChain*)Chain)->Links), object); ((ILibChain_Link*)object)->ParentChain = Chain; }