ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  C++ - Who owns the memory for the StringArray used in BaseChart.setMonthNames?
Posted by Doug Schmidt on Nov-08-2012 00:59
Using C++ here.

Does the void  BaseChart.setMonthNames( StringArray newMonthNames ) method copy the
string data out of the StringArray parameter before the call returns, or does my program
need to keep the data pointers alive until the chart is destructed?

The documentation makes no claims either way, and I don't want to be leaking memory or
freeing pointers prematurely.

  Re: C++ - Who owns the memory for the StringArray used in BaseChart.setMonthNames?
Posted by Peter Kwan on Nov-08-2012 15:20
Hi Doug,

ChartDirector will make a copy of the names before the call returns. You can free the memory for the text strings immediately after this method returns.

Hope this can help.

Regards
Peter Kwan