Search found 7 matches

by khs
Tue Nov 14, 2006 2:05 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

test

Also, the code that is produced for MessageBox(0, siLang1->GetTextOrDefault("IDS_xx").c_str(), siLang1->GetTextOrDefault("IDS_yy").c_str(), MB_OK); seems fine: first twice { construction of parameter-AnsiString and result-AnsiString, call to GetTextOrDefault }, then the MessageBo...
by khs
Tue Nov 14, 2006 1:00 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

...

... that has to do with buggy handling of temporary objects used during the construction of arrays.
by khs
Tue Nov 14, 2006 12:57 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

...

Just found this totally by chance:

http://qc.borland.com/wc/qcmain.aspx?d=668

So it seems we have a neatly isolated problem here.
by khs
Mon Nov 13, 2006 7:04 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

...

Yes, in general using GetTextOrDefault only in very simple constructs seems to be a good idea. Or updating to Turbo C++... ;)

So is delete[] ok for the returned char *?
by khs
Mon Nov 13, 2006 4:24 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

...

I think I have found the source of the AV. The GetTextOrDefault functions take "const AnsiString" as an argument, meaning in C++Builder a temporary AnsiString is constructed out of whatever parameter is passed. However, previous versions of Builder are buggy when handling temporaries. This...
by khs
Mon Nov 13, 2006 3:54 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

...

Using plain delete[]?
by khs
Mon Nov 13, 2006 1:26 pm
Forum: TsiLang Components Suite
Topic: GetTextOrDefaultC: freeing memory?
Replies: 10
Views: 15105

GetTextOrDefaultC: freeing memory?

Hi there,

just a short question: how/when is freeing the memory which seems to be allocated by GetTextOrDefaultC done, or do I do it myself? Trying to track down an AV here...

Greetings,
khs