Skip to content

Commit 9de8592

Browse files
authored
Enhance KillThread checks for thread validity
1 parent e56d9ed commit 9de8592

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DataModelBase/Utilities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bool Utilities::KillThread(Thread_args* &args){
6262

6363
bool ret=false;
6464

65-
if(args){
65+
if(args && args->thread){
6666

6767
args->running=false;
6868
args->kill=true;
@@ -78,7 +78,7 @@ bool Utilities::KillThread(Thread_args* &args){
7878
}
7979

8080
bool Utilities::KillThread(std::string ThreadName){
81-
81+
if(Threads.count(ThreadName) == 0 ) return false;
8282
return KillThread(Threads[ThreadName]);
8383

8484
}

0 commit comments

Comments
 (0)