From 129892f71bad1a6552c8a8b8cffd850166012def Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 8 Jun 2015 15:45:59 +0300 Subject: [PATCH] Handle lost context on android devices in properly way. When starling trying to handle lost context on android, it gets error when restoring textures that was created from bitmaps. because that bitmaps were disposed. BUT there maybe memory leaks (mb they doesn't, i didn't check yet). --- .../com/catalystapps/gaf/core/ZipToGAFAssetConverter.as | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gaf/src/com/catalystapps/gaf/core/ZipToGAFAssetConverter.as b/gaf/src/com/catalystapps/gaf/core/ZipToGAFAssetConverter.as index 3d94503..d2bf6d2 100644 --- a/gaf/src/com/catalystapps/gaf/core/ZipToGAFAssetConverter.as +++ b/gaf/src/com/catalystapps/gaf/core/ZipToGAFAssetConverter.as @@ -573,9 +573,10 @@ package com.catalystapps.gaf.core else { this.gfxData.removeImages(); - for each (var bd: BitmapData in this.pngImgs) - { - bd.dispose(); + if (!Starling.handleLostContext) { + for each (var bd : BitmapData in this.pngImgs) { + bd.dispose(); + } } this.pngImgs = null; }