Fix memory leak with arthur style
ASAN reports a leak here, so let's delete the style after the widgets using them have been destroyed. Change-Id: I0e8603fc5d2d0c13deca35a1c0020646c65eaf49 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
parent
90243aebb6
commit
b4a1336bb0
@ -56,13 +56,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QScopedPointer<QStyle> arthurStyle(new ArthurStyle());
|
||||
CompositionWidget compWidget(nullptr);
|
||||
QStyle *arthurStyle = new ArthurStyle();
|
||||
compWidget.setStyle(arthurStyle);
|
||||
compWidget.setStyle(arthurStyle.data());
|
||||
|
||||
const QList<QWidget *> widgets = compWidget.findChildren<QWidget *>();
|
||||
for (QWidget *w : widgets)
|
||||
w->setStyle(arthurStyle);
|
||||
w->setStyle(arthurStyle.data());
|
||||
compWidget.show();
|
||||
|
||||
return app.exec();
|
||||
|
Loading…
x
Reference in New Issue
Block a user