Fix destruction and tear down of the embedding thread. (#2328)

* Fix destruction and tear down of the embedding thread.

Signed-off-by: Adam Treat <treat.adam@gmail.com>

* Fix order of deletion to prevent use after free.

Signed-off-by: Adam Treat <treat.adam@gmail.com>

---------

Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
AT
2024-05-15 09:01:53 -05:00
committed by GitHub
parent 1427ef7195
commit 61cefcfd8a
3 changed files with 10 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ private:
QNetworkAccessManager *m_networkManager;
std::vector<float> m_lastResponse;
LLModel *m_model = nullptr;
std::atomic<bool> m_stopGenerating;
QThread m_workerThread;
};