mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2820 from minggo/develop
fixed #2161: don't close AssetManager
This commit is contained in:
commit
f2be4c62ee
|
@ -65,7 +65,6 @@ public class Cocos2dxETCLoader {
|
||||||
|
|
||||||
texture = ETC1Util.createTexture(inputStream);
|
texture = ETC1Util.createTexture(inputStream);
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
assetManager.close();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.d("Cocos2dx", "Unable to create texture for " + filePath);
|
Log.d("Cocos2dx", "Unable to create texture for " + filePath);
|
||||||
|
|
||||||
|
@ -73,6 +72,8 @@ public class Cocos2dxETCLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture != null) {
|
if (texture != null) {
|
||||||
|
boolean ret = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int width = texture.getWidth();
|
int width = texture.getWidth();
|
||||||
int height = texture.getHeight();
|
int height = texture.getHeight();
|
||||||
|
@ -88,9 +89,10 @@ public class Cocos2dxETCLoader {
|
||||||
} catch (Exception e)
|
} catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.d("invoke native function error", e.toString());
|
Log.d("invoke native function error", e.toString());
|
||||||
|
ret = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue