mardi 30 décembre 2014

dismissing GLKViewController does not free memory

I got a question to ask. Currently, dismissing GLKViewController is not deallocating the memory at all. Rather, it takes more memory whenever I move to the GLKViewController and dismiss it. My game starts at 100MB. Whenever I play a game, it adds up about 10MB. So, if I play it 10 times, it will be about 200MB in the end. It will crash eventually.


This is my only reference to the GLKViewController. I do not call it anywhere in my uiviewcontroller anywhere other than that. I use modal segue to move to glkviewcontroller.


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { Game *renderer = [segue destinationViewController]; [renderer setDelegate:self]; renderer.bomb = bomb; }


And I dismiss it using [self dismissViewControllerAnimated:YES completion:nil]


Do you know how to fix this problem? It is wasting so much time right now. Thanks.




Aucun commentaire:

Enregistrer un commentaire