From fb43e29dd5ccadb5f65e487940785f295873bf56 Mon Sep 17 00:00:00 2001 From: Patrick Meehan Date: Thu, 26 May 2016 16:54:30 -0700 Subject: [PATCH] fixed annoying regression where moai couldn't run without a gl context --- src/moai-sim/MOAIGfxResourceClerk.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/moai-sim/MOAIGfxResourceClerk.cpp b/src/moai-sim/MOAIGfxResourceClerk.cpp index 622062e64e..d95fb3ac6d 100644 --- a/src/moai-sim/MOAIGfxResourceClerk.cpp +++ b/src/moai-sim/MOAIGfxResourceClerk.cpp @@ -14,12 +14,14 @@ //----------------------------------------------------------------// void MOAIGfxResourceClerk::DeleteOrDiscardHandle ( ZLGfxHandle*& handle, bool shouldDelete ) { - if ( shouldDelete && MOAIGfxMgr::IsValid ()) { - - MOAIGfxMgr::Get ().mResourceMgr.mDeleterStack.Push ( handle ); - return; + if ( handle ) { + if ( shouldDelete && MOAIGfxMgr::IsValid ()) { + + MOAIGfxMgr::Get ().mResourceMgr.mDeleterStack.Push ( handle ); + return; + } + ZLGfx::Discard ( handle ); } - ZLGfx::Discard ( handle ); } //----------------------------------------------------------------//