vengi-voxel / vengi

free and open source voxel art tools - editor, thumbnailer and format converter
http://vengi-voxel.github.io/vengi/
Other
1.05k stars 87 forks source link

APP: crashes on windows in FL_FindLocale #467

Closed mgerhardy closed 1 month ago

mgerhardy commented 1 month ago

System locale was english

Stack trace (most recent call last):
#25   Object "", at 00007FFB1E5EAA48, in RtlUserThreadStart
#24   Object "", at 00007FFB1D91257D, in BaseThreadInitThunk
#23   Object "", at 00007FF7A0C5C18E, in  ?? 
#22   Object "", at 00007FF7A0C5BE5E, in  ?? 
#21   Object "", at 00007FF7A0C5BF9E, in  ?? 
#20   Object "", at 00007FF7A0C5C0F9, in  ?? 
#19   Object "", at 00007FF7A0E0A402, in  ?? 
#18   Object "", at 00007FF7A0E0A375, in  ?? 
#17   Object "", at 00007FF7A03E94CE, in  ?? 
#16   Object "", at 00007FF7A0410180, in  ?? 
#15   Object "", at 00007FF7A041369C, in  ?? 
#14   Object "", at 00007FF7A03EE712, in  ?? 
#13   Object "", at 00007FF7A041DCBC, in  ?? 
#12   Object "", at 00007FF7A04103F4, in  ?? 
#11   Object "", at 00007FF7A0939FB9, in  ?? 
#10   Object "", at 00007FF7A097A434, in  ?? 
#9    Object "", at 00007FF7A0999237, in  ?? 
#8    Object "", at 00007FFB1E6339EE, in KiUserExceptionDispatcher
#7    Object "", at 00007FFB1E5AE466, in RtlFindCharInUnicodeString
#6    Object "", at 00007FFB1E6349FF, in _chkstk
#5    Object "", at 00007FFB1E61F187, in _C_specific_handler
#4    Object "", at 00007FFB1E63907D, in RtlCopyMemory
#3    Object "", at 00007FFB1BA3CD9C, in UnhandledExceptionFilter
#2    Object "", at 00007FF7A04141D1, in  ?? 
#1    Object "", at 00007FF7A093D5FC, in  ?? 
#0    Object "", at 00007FF7A094EF92, in  ?? 

Commenting this section in App.cpp

    FL_Locale *locale;
    FL_FindLocale(&locale, FL_MESSAGES);
    _systemLanguage = Language::fromSpec(locale->lang, locale->country, locale->variant);
    if (!_systemLanguage) {
        _systemLanguage = Language::fromSpec("en", "GB");
    }
    FL_FreeLocale(&locale);

and the apps are working again on windows.

mgerhardy commented 1 month ago

FL_FindLocale return value is not checked - nor the locale pointer values that are converted into String classes - but can be nullptr