From 112d4828bb192bbb154a781dab999a280874a712 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Tue, 23 Oct 2018 22:16:54 +0300 Subject: [PATCH] Update StackStrF to initialize without a default VM. --- include/sqrat/sqratUtil.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/sqrat/sqratUtil.h b/include/sqrat/sqratUtil.h index aabcac57..74a5b05b 100644 --- a/include/sqrat/sqratUtil.h +++ b/include/sqrat/sqratUtil.h @@ -1556,7 +1556,7 @@ struct StackStrF , mLen(0) , mRes(SQ_OK) , mObj() - , mVM(DefaultVM::Get()) + , mVM(nullptr) , mIdx(-1) { sq_resetobject(&mObj); // Reset the converted value object @@ -1570,7 +1570,7 @@ struct StackStrF , mLen(N) , mRes(SQ_OK) , mObj() - , mVM(DefaultVM::Get()) + , mVM(nullptr) , mIdx(-1) { sq_resetobject(&mObj); // Reset the converted value object @@ -1639,6 +1639,11 @@ struct StackStrF ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// SQRESULT Proc(bool fmt = false, bool dummy = false) { + // If there's no virtual machine, just ignore the request + if (mVM == nullptr) + { + return SQ_OK; + } // Reset the converted value object sq_resetobject(&mObj); // is this a dummy request?