Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory in android, after many calls to InitializeEverything #19

Closed
unitycoder opened this issue Feb 17, 2016 · 4 comments
Closed
Labels

Comments

@unitycoder
Copy link
Owner

http://forum.unity3d.com/threads/released-mobile-paint-with-multi-touch.262645/page-4#post-2513834

@unitycoder unitycoder added the bug label Feb 17, 2016
@unitycoder
Copy link
Owner Author

texture amount gets increased each initialize call..
coming from this line:
drawingTexture = new Texture2D(texWidth, texHeight, TextureFormat.RGBA32, false);

@unitycoder
Copy link
Owner Author

temporary fix:
// FIND LINE
drawingTexture = new Texture2D(texWidth, texHeight, TextureFormat.RGBA32, false);

// CHANGE TO

if (drawingTexture==null)
{
    drawingTexture = new Texture2D(texWidth, texHeight, TextureFormat.RGBA32, false);
}

@unitycoder
Copy link
Owner Author

better fix, because the previous one wouldnt re-initialize it to new size etc.

// FIND LINE
drawingTexture = new Texture2D(texWidth, texHeight, TextureFormat.RGBA32, false);

// CHANGE TO

if (drawingTexture != null) Texture2D.DestroyImmediate(drawingTexture , true);
drawingTexture = new Texture2D(texWidth, texHeight, TextureFormat.RGBA32, false);

thanks to theLaymaster:
http://forum.unity3d.com/threads/released-mobile-paint-with-multi-touch.262645/page-4#post-2518199

@unitycoder
Copy link
Owner Author

fixed in the coming v1.96 update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant