Skip to content

Commit

Permalink
fix: access wild pointer
Browse files Browse the repository at this point in the history
iconButton's ownership is caller, it will access wild pointer
if it's released in 1ms.
  • Loading branch information
18202781743 committed Jan 23, 2025
1 parent e8f4811 commit a7e4271
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dss-network-plugin/network_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ QWidget *NetworkPlugin::itemWidget() const
iconButton->setFlat(true);
iconButton->setAttribute(Qt::WA_TransparentForMouseEvents);
iconButton->setIconSize({26, 26});
QTimer::singleShot(1, [this, iconButton]() {
QTimer::singleShot(1, iconButton, [this, iconButton]() {
const_cast<NetworkPlugin *>(this)->ensureNetwork();
auto helper = m_network->networkHelper();
iconButton->setIcon(*helper->trayIcon());
Expand Down

0 comments on commit a7e4271

Please sign in to comment.