diff --git a/starling/src/starling/filters/FragmentFilter.as b/starling/src/starling/filters/FragmentFilter.as index 094edc034..9d1d8acf0 100644 --- a/starling/src/starling/filters/FragmentFilter.as +++ b/starling/src/starling/filters/FragmentFilter.as @@ -143,8 +143,9 @@ package starling.filters mIndexData = new [0, 1, 2, 1, 3, 2]; mIndexData.fixed = true; - - createPrograms(); + + if (Starling.current.contextValid) + createPrograms(); // Handle lost context. By using the conventional event, we can make it weak; this // avoids memory leaks when people forget to call "dispose" on the filter. diff --git a/starling/src/starling/textures/RenderTexture.as b/starling/src/starling/textures/RenderTexture.as index e7af74fe6..ac31dfe3a 100644 --- a/starling/src/starling/textures/RenderTexture.as +++ b/starling/src/starling/textures/RenderTexture.as @@ -220,6 +220,7 @@ package starling.textures /* var context:Context3D = Starling.context; if (context == null) throw new MissingContextError(); + if (!Starling.current.contextValid) return; // switch buffers if (isDoubleBuffered) @@ -266,6 +267,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);