From 0f6b16d1e08b05826d2ce93295e510842eef4b53 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Wed, 8 Nov 2023 07:22:43 +0800 Subject: [PATCH] ui/wifi.cc: fix small QPixmap leak (#30395) fix QPixmap leaks --- selfdrive/ui/qt/widgets/wifi.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/ui/qt/widgets/wifi.cc b/selfdrive/ui/qt/widgets/wifi.cc index ed5825ab77..9c5289a22d 100644 --- a/selfdrive/ui/qt/widgets/wifi.cc +++ b/selfdrive/ui/qt/widgets/wifi.cc @@ -18,8 +18,8 @@ WiFiPromptWidget::WiFiPromptWidget(QWidget *parent) : QFrame(parent) { title_layout->setSpacing(32); { QLabel *icon = new QLabel; - QPixmap *pixmap = new QPixmap("../assets/offroad/icon_wifi_strength_full.svg"); - icon->setPixmap(pixmap->scaledToWidth(80, Qt::SmoothTransformation)); + QPixmap pixmap("../assets/offroad/icon_wifi_strength_full.svg"); + icon->setPixmap(pixmap.scaledToWidth(80, Qt::SmoothTransformation)); title_layout->addWidget(icon); QLabel *title = new QLabel(tr("Setup Wi-Fi")); @@ -68,8 +68,8 @@ WiFiPromptWidget::WiFiPromptWidget(QWidget *parent) : QFrame(parent) { title_layout->addStretch(); QLabel *icon = new QLabel; - QPixmap *pixmap = new QPixmap("../assets/offroad/icon_wifi_uploading.svg"); - icon->setPixmap(pixmap->scaledToWidth(120, Qt::SmoothTransformation)); + QPixmap pixmap("../assets/offroad/icon_wifi_uploading.svg"); + icon->setPixmap(pixmap.scaledToWidth(120, Qt::SmoothTransformation)); title_layout->addWidget(icon); } uploading_layout->addLayout(title_layout);