Skip to content

Commit 9af197e

Browse files
committed
Fixed indent issue and correctly unset TZ
1 parent 9c3246f commit 9af197e

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Release/src/pplx/threadpool.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ JNIEnv* get_jvm_env()
3232
{
3333
if (JVM == nullptr)
3434
{
35-
throw std::runtime_error("Could not contact JVM");
35+
throw std::runtime_error("Could not contact JVM");
3636
}
3737
if (JVM_ENV == nullptr)
3838
{
39-
auto result = JVM.load()->AttachCurrentThread(&crossplat::JVM_ENV, nullptr);
40-
if (result != JNI_OK)
41-
{
42-
throw std::runtime_error("Could not attach to JVM");
43-
}
39+
auto result = JVM.load()->AttachCurrentThread(&crossplat::JVM_ENV, nullptr);
40+
if (result != JNI_OK)
41+
{
42+
throw std::runtime_error("Could not attach to JVM");
43+
}
4444
}
4545

4646
return JVM_ENV;

Release/src/utilities/asyncrt_utils.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,14 @@ datetime __cdecl datetime::from_string(const utility::string_t& dateString, date
907907

908908
time = mktime(&output);
909909

910-
setenv("TZ", prev_env.c_str(), 1);
910+
if (prev_env_cstr)
911+
{
912+
setenv("TZ", prev_env.c_str(), 1);
913+
}
914+
else
915+
{
916+
unsetenv("TZ");
917+
}
911918
}
912919
#else
913920
time_t time = timegm(&output);

0 commit comments

Comments
 (0)