diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-08-03 02:27:43 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-08-03 02:27:43 -0400 |
commit | a61a630ee675e18f12e8725cca731cbe8aa429ce (patch) | |
tree | 7705056668804da6ddcefa1752afde93122a70ff /src | |
parent | 4e4986f6709cfc7f8e4cae734e8579695f3c07b4 (diff) | |
download | abaddon-portaudio-a61a630ee675e18f12e8725cca731cbe8aa429ce.tar.gz abaddon-portaudio-a61a630ee675e18f12e8725cca731cbe8aa429ce.zip |
handle null from std::locale::locale (fixes #88)
Diffstat (limited to 'src')
-rw-r--r-- | src/abaddon.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/abaddon.cpp b/src/abaddon.cpp index 2e8ecaa..c849fd6 100644 --- a/src/abaddon.cpp +++ b/src/abaddon.cpp @@ -898,11 +898,15 @@ int main(int argc, char **argv) { char *systemLocale = std::setlocale(LC_ALL, ""); try { - std::locale::global(std::locale(systemLocale)); + if (systemLocale != nullptr) { + std::locale::global(std::locale(systemLocale)); + } } catch (...) { try { std::locale::global(std::locale::classic()); - std::setlocale(LC_ALL, systemLocale); + if (systemLocale != nullptr) { + std::setlocale(LC_ALL, systemLocale); + } } catch (...) {} } |