Clear the cached value when re-using the JSON deserializer

Ensure that we clear the deserializer state when re-use it after
unsuccessful deresializing.

Pick-to: 6.9 6.8
Change-Id: I6e0c489706b90e8daaa49c1872642a7cbefee2e3
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
This commit is contained in:
Alexey Edelev 2025-01-03 14:13:50 +01:00
parent 9966fdac34
commit 9d680f05fd
1 changed files with 1 additions and 0 deletions

View File

@ -258,6 +258,7 @@ QProtobufJsonDeserializerImpl::~QProtobufJsonDeserializerImpl()
void QProtobufJsonDeserializerImpl::reset(QJsonObject obj)
{
clearCachedValue();
m_state.clear();
if (!obj.isEmpty())
m_state.push_back({ obj });