Skip to content

Commit

Permalink
fix: prevent double free on DigitsRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
acolombier committed Nov 10, 2024
1 parent 694542d commit e4ea6c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/waveform/renderers/allshader/digitsrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ void allshader::DigitsRenderer::updateTexture(
blur->setBlurRadius(static_cast<qreal>(m_penWidth) / 3);

QGraphicsScene scene;
QGraphicsPixmapItem item;
item.setPixmap(QPixmap::fromImage(image));
item.setGraphicsEffect(blur.release());
auto item = std::make_unique<QGraphicsPixmapItem>();
item->setPixmap(QPixmap::fromImage(image));
item->setGraphicsEffect(blur.release());
image.fill(Qt::transparent);
QPainter painter(&image);
scene.addItem(&item);
scene.addItem(item.release());
scene.render(&painter, QRectF(), QRectF(0, 0, image.width(), image.height()));
}

Expand Down

0 comments on commit e4ea6c5

Please sign in to comment.