SChartBackedUserSettable and alot of styles not deallocating


#1

I came across a lot of crashes due to memory issues after opening and closing viewcontroller containing Charts.
I looked into Instruments tool and found that SChartBackedUserSettable and alot of Style object are still alive when the viewcontroller closed.

It consumes 3~4 MB every time I open/close the ViewController.My ViewController and the View holding chart recieves dealloc message. 

Am my missing something obvious ? How can I make these dealloc when I close the ViewController ? 


#2

Hi Akash,

The style objects are due to the static SChartTheme singleton that exists on ShinobiCharts.

You can release this memory by adding the following to your view controller:

- (void)dealloc {
    [ShinobiCharts setTheme:nil];
}

However, this is likely to be unrelated to the crashes you are experiencing. If you wouldn’t mind replicating them in a small sample and sending that to us we’ll be able to help you a little more.

Kind regards,

Sam