Commit c277ed7d authored by Christoph Cullmann's avatar Christoph Cullmann 🍨
Browse files

avoid double delete

BUG: 459520
parent 9e6cc0a8
Pipeline #236111 passed with stage
in 5 minutes and 48 seconds
......@@ -41,10 +41,8 @@ void DiffSyntaxHighlighter::highlightBlock(const QString &text)
// comment block
// do this only if not anyways first block, there user data is not existing
if (currentBlock().position() > 0 && m_diffWidget->isHunk(currentBlock().blockNumber())) {
auto prevBlock = currentBlock().previous();
const auto prevData = prevBlock.userData();
delete prevData;
prevBlock.setUserData(new QTextBlockUserData);
// ownership of the data is in the block, just reset it by assigning a new dummy data
currentBlock().previous().setUserData(new QTextBlockUserData);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment