From 83f299bbc30b0dcee7341c052037eb06679d1433 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Mon, 27 Mar 2023 09:49:20 +0800 Subject: [PATCH] fix: a possible bug at rare conditions , the for loop will continue to run until the request is canceled. --- mdx.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mdx.cc b/mdx.cc index 983a1107..a787bc93 100644 --- a/mdx.cc +++ b/mdx.cc @@ -750,8 +750,10 @@ void MddResourceRequest::run() return; } string u8ResourceName = Utf8::encode( resourceName ); - if( !resourceIncluded.insert( resourceName ).second ) - continue; + if( !resourceIncluded.insert( resourceName ).second ) { + finish(); + return; + } Mutex::Lock _( dataMutex ); data.clear();