diff --git a/onnxruntime/test/mlas/unittest.cpp b/onnxruntime/test/mlas/unittest.cpp index e41cf1e2cf476..f932d7f8f40da 100644 --- a/onnxruntime/test/mlas/unittest.cpp +++ b/onnxruntime/test/mlas/unittest.cpp @@ -1995,7 +1995,7 @@ main( printf("Done.\n"); #if !defined(MLAS_NO_ONNXRUNTIME_THREADPOOL) - threadpool = new onnxruntime::concurrency::ThreadPool("test", 2); + if(threadpool != nullptr) threadpool = new onnxruntime::concurrency::ThreadPool("test", 2); #else break; #endif