mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-13 21:42:52 -05:00
fix: Clean resources after finish request
This commit is contained in:
@ -337,12 +337,18 @@ void ClientInterface::handleFullResponse(const QString &requestId, const QString
|
|||||||
LOG_MESSAGE(QString("Some edits for request %1 were not auto-applied: %2")
|
LOG_MESSAGE(QString("Some edits for request %1 were not auto-applied: %2")
|
||||||
.arg(requestId, applyError));
|
.arg(requestId, applyError));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_activeRequests.erase(it);
|
|
||||||
m_accumulatedResponses.remove(requestId);
|
|
||||||
|
|
||||||
LOG_MESSAGE("Message completed. Final response for message " + ctx.originalRequest["id"].toString() + ": " + finalText);
|
LOG_MESSAGE(
|
||||||
|
"Message completed. Final response for message " + ctx.originalRequest["id"].toString()
|
||||||
|
+ ": " + finalText);
|
||||||
emit messageReceivedCompletely();
|
emit messageReceivedCompletely();
|
||||||
|
|
||||||
|
if (it != m_activeRequests.end()) {
|
||||||
|
m_activeRequests.erase(it);
|
||||||
|
}
|
||||||
|
if (m_accumulatedResponses.contains(requestId)) {
|
||||||
|
m_accumulatedResponses.remove(requestId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientInterface::handleRequestFailed(const QString &requestId, const QString &error)
|
void ClientInterface::handleRequestFailed(const QString &requestId, const QString &error)
|
||||||
@ -354,8 +360,12 @@ void ClientInterface::handleRequestFailed(const QString &requestId, const QStrin
|
|||||||
LOG_MESSAGE(QString("Chat request %1 failed: %2").arg(requestId, error));
|
LOG_MESSAGE(QString("Chat request %1 failed: %2").arg(requestId, error));
|
||||||
emit errorOccurred(error);
|
emit errorOccurred(error);
|
||||||
|
|
||||||
m_activeRequests.erase(it);
|
if (it != m_activeRequests.end()) {
|
||||||
m_accumulatedResponses.remove(requestId);
|
m_activeRequests.erase(it);
|
||||||
|
}
|
||||||
|
if (m_accumulatedResponses.contains(requestId)) {
|
||||||
|
m_accumulatedResponses.remove(requestId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientInterface::handleCleanAccumulatedData(const QString &requestId)
|
void ClientInterface::handleCleanAccumulatedData(const QString &requestId)
|
||||||
|
|||||||
Reference in New Issue
Block a user