Game Development Community

TGB 1.7.3beta1 bug - crash in LangFile deconstructor

by Randy Condon · in Torque Game Builder · 05/09/2008 (6:06 pm) · 2 replies

I actually found this in 1.7.2 (and also TGE 1.4, and probably TGE 1.5.2)
Since y'all are looking at the Beta, I thought this would be a good place to post. I'm guessing it's still in the Beta.

I created a language table in script and added the language to the game.
When quitting the app, via the script call "quit()", I got a crash in the (code side) deconstructor LangFile::~LangFile(), in the call to SAFE_DELETE(mLangName); (This was all in a debug build, by the way).

Changing the SAFE_DELETE(mLangName) to SAFE_DELETE_ARRAY(mLangName) fixed the problem.
(and likewise for SAFE_DELETE_ARRAY(mLangFile))

If I did something wrong in creating the language table, my apologies.

Here's my script code in game/main.cs to create the language table:

if(isObject($I18N::FBDO))
      $I18N::FBDO.delete();
   $I18N::FBDO = new LangTable();
   exec("game/lang/tables/English.cs");
   $I18N::FBDO.addLanguage("game/lang/tables/English.lso", "English");
   $I18N::FBDO.setDefaultLanguage(0); 
   $I18N::FBDO.setCurrentLanguage(0);

The appropriate language files/directories as implied by the above calls are in place. The system works for placing text via the langTableMod variable.

#1
05/10/2008 (10:40 am)
Good catch. Same error in TGEA. Fixed.
#2
05/10/2008 (1:20 pm)
Logged for TGB as well, TGB-84.