simutrans r2173 SDL, GDI
When starting simutrans, it crashed.
How to reproduce:
1. Strart Simutrans with command line "-log 1 -debug 4".
2. Change language to Japanese.
3. Quit Simutrans.
4. Strart Simutrans with command line "-log 1 -debug 4".
Result:
Crash.
Note:
If I remove "simuconf.close();" on simmain.cc line:366, simutrans don't crash.
This is the reason I rewrite the patch. But I can't understand why this causes crash with my poor c++ skill.
Message: create_win(): ins_win=0
Message: create_win(): new ins_win=1
Message: toolbar_t::init(): ID=32768d
Message: karte_t::reset_timer(): called
Message: karte_t::reset_timer(): called
sim.exe caused an Access Violation at location 005a9d78 in module sim.exe Reading from location 02303c8d.
Registers:
eax=022fb260 ebx=00f80000 ecx=000000f0 edx=00008a2d esi=00000000 edi=00000000
eip=005a9d78 esp=0023ea50 ebp=0023fa18 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000206
Call stack:
005A9D78 sim.exe:005A9D78 display_calc_proportional_string_len_width(char const*, int) simgraph16.cc:2477
...
iUnicode = utf8_to_utf16((utf8 const*)text + iLen, &iLen);
if (iUnicode == 0) return width;
> w = fnt->screen_width[iUnicode];
if (w == 0) {
// default width for missing characters
...
005ADDC3 sim.exe:005ADDC3 WinMain simsys_w16.cc:756
00401247 sim.exe:00401247
00401298 sim.exe:00401298
7C817067 kernel32.dll:7C817067 RegisterWaitForInputIdle