Skip to content

Commit 95d98af

Browse files
committed
Call deleteLater only when writeJob is not a nullptr.
Fix for #7996. Signed-off-by: Camila Ayres <[email protected]>
1 parent cc50f8d commit 95d98af

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/libsync/creds/keychainchunk.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob)
171171
qCWarning(lcKeychainChunk) << "Error while writing" << writeJob->key() << "chunk" << writeJob->errorString();
172172
_chunkBuffer.clear();
173173
}
174+
175+
writeJob->deleteLater();
174176
}
175177

176178
// write a chunk if there is any in the buffer
@@ -191,9 +193,7 @@ void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob)
191193

192194
// keep the limit
193195
if (_chunkCount > KeychainChunk::MaxChunks) {
194-
qCWarning(lcKeychainChunk) << "Maximum chunk count exceeded while writing" << writeJob->key() << "chunk" << QString::number(index) << "cutting off after" << QString::number(KeychainChunk::MaxChunks) << "chunks";
195-
196-
writeJob->deleteLater();
196+
qCWarning(lcKeychainChunk) << "Maximum chunk count exceeded while writing chunk" << QString::number(index) << "cutting off after" << QString::number(KeychainChunk::MaxChunks) << "chunks";
197197

198198
_chunkBuffer.clear();
199199

@@ -231,8 +231,6 @@ void WriteJob::slotWriteJobDone(QKeychain::Job *incomingJob)
231231
deleteLater();
232232
}
233233
}
234-
235-
writeJob->deleteLater();
236234
}
237235

238236
/*

0 commit comments

Comments
 (0)