From aef1ab2dc5c9200e982dfe99fcb2f9b535ffdec9 Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Thu, 17 Aug 2017 18:39:19 +0100 Subject: [PATCH 1/2] [[ Bug 19420 ]] Initialise event queue on startup --- engine/src/dskmain.cpp | 4 ++++ engine/src/em-dc-mainloop.cpp | 7 +++++++ engine/src/globals.cpp | 3 +++ engine/src/mblmain.cpp | 4 ++++ engine/src/srvmain.cpp | 4 ++++ 5 files changed, 22 insertions(+) diff --git a/engine/src/dskmain.cpp b/engine/src/dskmain.cpp index 804e5a5b1c5..bfa39c5fe1f 100644 --- a/engine/src/dskmain.cpp +++ b/engine/src/dskmain.cpp @@ -39,6 +39,7 @@ along with LiveCode. If not see . */ #include "font.h" #include "stacksecurity.h" #include "system.h" +#include "eventqueue.h" //////////////////////////////////////////////////////////////////////////////// @@ -114,6 +115,9 @@ bool X_init(int argc, MCStringRef argv[], MCStringRef envp[]) // MW-2012-02-23: [[ FontRefs ]] Initialize the logical font table module. MCLogicalFontTableInitialize(); + // Initialize the event queue + MCEventQueueInitialize(); + //// MCswapbytes = byte_swapped(); diff --git a/engine/src/em-dc-mainloop.cpp b/engine/src/em-dc-mainloop.cpp index 717cf296758..8b54c1af907 100644 --- a/engine/src/em-dc-mainloop.cpp +++ b/engine/src/em-dc-mainloop.cpp @@ -30,6 +30,7 @@ along with LiveCode. If not see . */ #include "system.h" #include "font.h" #include "util.h" +#include "eventqueue.h" #include @@ -143,6 +144,12 @@ X_init(int argc, goto error_cleanup; } + // Initialize the event queue + if (!MCEventQueueInitialize()) + { + goto error_cleanup; + } + /* ---------- More globals */ /* executable file name */ diff --git a/engine/src/globals.cpp b/engine/src/globals.cpp index d71d4f5336f..e0b0e8e3098 100644 --- a/engine/src/globals.cpp +++ b/engine/src/globals.cpp @@ -1471,6 +1471,9 @@ int X_close(void) // Cleanup the parentscript stuff MCParentScript::Cleanup(); + // Finalize the event queue + MCEventQueueFinalize(); + // MW-2012-02-23: [[ LogFonts ]] Finalize the font table module. MCLogicalFontTableFinalize(); // MW-2012-02-23: [[ FontRefs ]] Finalize the font module. diff --git a/engine/src/mblmain.cpp b/engine/src/mblmain.cpp index 4c892f2e679..bd799baeb0f 100644 --- a/engine/src/mblmain.cpp +++ b/engine/src/mblmain.cpp @@ -37,6 +37,7 @@ along with LiveCode. If not see . */ #include "redraw.h" #include "system.h" #include "font.h" +#include "eventqueue.h" //////////////////////////////////////////////////////////////////////////////// @@ -105,6 +106,9 @@ bool X_init(int argc, MCStringRef argv[], int envc, MCStringRef envp[]) // MW-2012-02-23: [[ FontRefs ]] Initialize the logical font table module. MCLogicalFontTableInitialize(); + // Initialize the event queue + MCEventQueueInitialize(); + // MM-2014-02-10: [[ LipOpenSSL 1.0.1e ]] Attempt load revsecurity library on Java side. #if defined(TARGET_SUBPLATFORM_ANDROID) extern bool revandroid_loadExternalLibrary(MCStringRef p_external, MCStringRef& r_filename); diff --git a/engine/src/srvmain.cpp b/engine/src/srvmain.cpp index b6269df550e..673804369b1 100644 --- a/engine/src/srvmain.cpp +++ b/engine/src/srvmain.cpp @@ -40,6 +40,7 @@ along with LiveCode. If not see . */ #include "uidc.h" #include "font.h" #include "libscript/script.h" +#include "eventqueue.h" //////////////////////////////////////////////////////////////////////////////// @@ -377,6 +378,9 @@ bool X_init(int argc, MCStringRef argv[], MCStringRef envp[]) // MW-2012-02-23: [[ FontRefs ]] Initialize the logical font table module. MCLogicalFontTableInitialize(); + // Initialize the event queue + MCEventQueueInitialize(); + //// // Create the basic locale and the system locale From 865913c9bf92129ab2984c5f69a37e5dd81bd9ed Mon Sep 17 00:00:00 2001 From: Ian Macphail Date: Thu, 17 Aug 2017 18:39:42 +0100 Subject: [PATCH 2/2] [[ Bug 19420 ]] Add release note --- docs/notes/bugfix-19420.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-19420.md diff --git a/docs/notes/bugfix-19420.md b/docs/notes/bugfix-19420.md new file mode 100644 index 00000000000..1c4a8e05caa --- /dev/null +++ b/docs/notes/bugfix-19420.md @@ -0,0 +1 @@ +# Fix crash on startup when resuming android app after quit