Forum rules - please read before posting.

iOS Camera Memory Leak?

Hi there,

I am creating a point and click Myst like adventure. I am using a new 2D camera for each new slide with a child 2D Sprite (for speed) and hotspots to switch between the cameras(slides). 

The problem is when testing my game on the iPad/iPhone every time the camera switches to a new slide (camera) the previous memory is not freed up.

Testing on the iPad 2 I can get about ten or so camera switches and then the game crashes as it's run out of RAM.

Is there any trick to this kind of set up or a way to tell adventure creator to purge the last slide?

Overall my game is coming along great but with this issue no one will be able to play it!

Please help,

Chris

Comments

  • Thinking About the issue. Is it because I'm adding the background sprite As a child of each camera?
  • Nope. That didn't help either. I moved all my slides to the set geometry folder in case they were screwing things up but the memory leak keeps happening.

    Next I'll turn off crossfade and see if that fixes the issue...
  • Cross fading definitely seems to be the problem for me. 

    Using switch instead uses about 100kb to memory usage when swapping cameras whereas crossfade uses about 10mb per camera change.

    Maybe this is a bug?
  • Definitely something wrong with crossfade. Just ran my game fully converted and no memory issues at all! - I'll continue without crossfade but it'll be nice if the issue gets some attention.


  • Thanks for the assistance in pointing out the source.  I will look into this and see if I can sort it out.
  • If you could test this for me, I'd appreciate it:

    Open up MainCamera.cs, and swap lines 594 and 595.  I think the problem might be that the texture is removed before it is destroyed.
  • Lines 594 and 595 are:

    FadeOut (0f);
    FadeIn (_changeTime);

    Swapping these lines causes the crossfade transition to not work at all. So you end up stuck on the first scene camera.
  • I was referring to v1.46 - you'll need to update before you do this.

    Lines should be:

    DestroyObject
     (crossfadeTexture);
    crossfadeTexture = null;
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.