- Home /
Received Memory Warning then crash iOS but I release resources?
I load into a VR photosphere Google 360 Panorama and my own Richoh Theta s 360 photos and all goes well.
In total my menu has 16 choices and when I choose to load number 10 I get an iOS memory warning but the app displays the photo and still runs.
When I go to load number 11 I get another warning then crash.
In my c# code that changes the photosphere material I "believe" I unload each previous material so presume I should be ok?
if (currentMaterial != null) {
Resources.UnloadAsset (currentMaterial);
}
// otherwise process for photo
currentMaterial = Resources.Load(materialName, typeof(Material)) as Material;
photoSphere.GetComponent<Renderer>().material = currentMaterial;
The thing is...I don't know how or what to enter in the iOS didReceiveMemery warning function? I know that is the place to do some damage limitation but I don't know how or what to reference?
Answer by elpuerco63 · Apr 20, 2016 at 06:09 PM
Think I figured it out!
Using Resources.UnloadUnusedAssets (); seems to do the trick
Your answer
Follow this Question
Related Questions
Memory Allocation Continues to Grow? iOS. 4.6.3 0 Answers
Leaks on iOS build related to Unity 0 Answers
Maximum RAM memory exceeded causes app to crash in iOS 1 Answer
cleanup allocated memory for texture2D 1 Answer
Memory leak on video players? 1 Answer