[vtkusers] Volume rendering memory warning

Import EV info at import-ev.com
Wed May 11 04:23:06 EDT 2016


I modified codes in "MyGLKViewController.mm" file in the sample Xcode
project "VolumeRender" for iOS provided here
(https://github.com/Kitware/VTK/tree/master/Examples/iOS) and am having
memory warning problem.

In my app I made 2 ViewControllers, one is a normal ViewController(TOP) and
the other is a GLKViewController(GLK) where I use the above modified codes.

In TOP, I made a UIButton. To click the button, view moves to GLK and
display volume rendering image. To click close button then back to TOP. When
repeat go back and forth between these 2 views, memory warning occurs.

I checked memory consumption and found the memory is not released when
closed GLK view.
I guess I need to release all the memory in the following method in
"MyGLKViewController.mm",

- (void)tearDownGL
{
  [EAGLContext setCurrentContext:self.context];

  // free GL resources
  // ...
}

When close GLK this method is called.
I have no idea, however, what codes I should use here.

It is appreciated if anyone gives me appropriate codes to avoid memory
warning?
Thanks.

-----
Import EV Corp.
-----



More information about the vtkusers mailing list