fix: a possible bug

at rare conditions ,  the for loop will continue to run until the request is canceled.
This commit is contained in:
xiaoyifang 2023-03-27 09:49:20 +08:00 committed by xiaoyifang
parent e84b5aa861
commit 83f299bbc3

6
mdx.cc
View file

@ -750,8 +750,10 @@ void MddResourceRequest::run()
return; return;
} }
string u8ResourceName = Utf8::encode( resourceName ); string u8ResourceName = Utf8::encode( resourceName );
if( !resourceIncluded.insert( resourceName ).second ) if( !resourceIncluded.insert( resourceName ).second ) {
continue; finish();
return;
}
Mutex::Lock _( dataMutex ); Mutex::Lock _( dataMutex );
data.clear(); data.clear();