From 5536714c4315b45ac46146db8ece3ee1d9696adf Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 30 Sep 2026 16:05:44 +0800 Subject: [PATCH] fix: stop event loop and release FileLoadThread on the exception path The catch branch of run() returned early, skipping quit() and deleteLater(), so the thread event loop never stopped and the thread object leaked when reading raised an exception. Log: Influence: file loading --- src/common/fileloadthread.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/fileloadthread.cpp b/src/common/fileloadthread.cpp index 97a2437c1..78c42b2a2 100644 --- a/src/common/fileloadthread.cpp +++ b/src/common/fileloadthread.cpp @@ -85,6 +85,10 @@ void FileLoadThread::run() file.close(); emit sigLoadFinished(encode, indata, true, false); + // Skip the common cleanup at the end of run(): stop the event loop + // and release the thread object, or both leak on the error path. + this->quit(); + this->deleteLater(); return; }