summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmSystemTools.cxx4
-rw-r--r--Source/cmakemain.cxx4
2 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index be799b0..2f08b84 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -823,7 +823,9 @@ void cmSystemTools::InitializeLibUV()
// Perform libuv one-time initialization now, and then un-do its
// global _fmode setting so that using libuv does not change the
// default file text/binary mode. See libuv issue 840.
- uv_loop_close(uv_default_loop());
+ if (uv_loop_t* loop = uv_default_loop()) {
+ uv_loop_close(loop);
+ }
# ifdef _MSC_VER
_set_fmode(_O_TEXT);
# else
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 75280fb..e0c17f8 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -717,6 +717,8 @@ int main(int ac, char const* const* av)
#ifndef CMAKE_BOOTSTRAP
cmDynamicLoader::FlushCache();
#endif
- uv_loop_close(uv_default_loop());
+ if (uv_loop_t* loop = uv_default_loop()) {
+ uv_loop_close(loop);
+ }
return ret;
}