From f997cc43c1244b8c9fa4d161cdedcc4f4d748a40 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 4 Dec 2013 17:03:34 -0400 Subject: [PATCH] =?UTF-8?q?Fixed=20a=20crashing=20issue=20when=20the=20err?= =?UTF-8?q?or=20handler=20can=E2=80=99t=20create=20a=20window?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/boot.lua | 3 ++- src/scripts/boot.lua.h | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index dedf76fc9..14218cf71 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -1520,7 +1520,8 @@ function love.errhand(msg) end if not love.graphics.isCreated() or not love.window.isCreated() then - if not pcall(love.window.setMode, 800, 600) then + local success, status = pcall(love.window.setMode, 800, 600) + if not success or not status then return end end diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index 0a647730b..1ffff20b8 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -5194,9 +5194,12 @@ const unsigned char boot_lua[] = 0x69, 0x63, 0x73, 0x2e, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x28, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x28, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, - 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6c, 0x6f, 0x76, - 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x2c, 0x20, - 0x38, 0x30, 0x30, 0x2c, 0x20, 0x36, 0x30, 0x30, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2c, 0x20, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x3d, 0x20, 0x70, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6c, 0x6f, 0x76, 0x65, + 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x2c, 0x20, 0x38, + 0x30, 0x30, 0x2c, 0x20, 0x36, 0x30, 0x30, 0x29, 0x0a, + 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x6f, + 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,