From dcae6e840369f0344f29a196bec56f032cb28482 Mon Sep 17 00:00:00 2001 From: stepan-beresnev Date: Sat, 8 Nov 2014 13:19:49 +0000 Subject: [PATCH] RenderTexture's draw and drawBundled methods threw exceptions if context was lost --- starling/src/starling/textures/RenderTexture.as | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/starling/src/starling/textures/RenderTexture.as b/starling/src/starling/textures/RenderTexture.as index 7b9e03e8a..1b8b2edbc 100644 --- a/starling/src/starling/textures/RenderTexture.as +++ b/starling/src/starling/textures/RenderTexture.as @@ -189,6 +189,8 @@ package starling.textures private function render(object:DisplayObject, matrix:Matrix=null, alpha:Number=1.0):void { + if (!Starling.current.contextValid) return; + var filter:FragmentFilter = object.filter; mSupport.loadIdentity(); @@ -208,6 +210,7 @@ package starling.textures { var context:Context3D = Starling.context; if (context == null) throw new MissingContextError(); + if (!Starling.current.contextValid) return; // switch buffers if (isDoubleBuffered) @@ -254,6 +257,7 @@ package starling.textures { var context:Context3D = Starling.context; if (context == null) throw new MissingContextError(); + if (!Starling.current.contextValid) return; mSupport.renderTarget = mActiveTexture; mSupport.clear(rgb, alpha);