diff options
author | Brad King <brad.king@kitware.com> | 2020-07-01 20:23:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-01 20:26:44 (GMT) |
commit | 0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b (patch) | |
tree | 6c044f6b78006ff245e12ed6f47dcdcdf6d0676f /Source/cmakemain.cxx | |
parent | 1e26c84b96c0ec6887de2cf5e14061ccb83bdbfe (diff) | |
download | CMake-0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b.zip CMake-0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b.tar.gz CMake-0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b.tar.bz2 |
cmake: Tolerate nullptr from uv_default_loop
`uv_default_loop()` can return `nullptr` when running on a Linux kernel
configured without `CONFIG_EVENTFD`.
Fixes: #20899
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |