mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Remove redundant null checks
Attempting to delete a null pointer is a noop in C++. Closes #2864. [1] https://isocpp.org/wiki/faq/freestore-mgmt#delete-handles-null
This commit is contained in:
parent
c78604c7d3
commit
6748e8d787
14 changed files with 37 additions and 72 deletions
|
@ -678,7 +678,7 @@ void MainWindow::displayRSSTab(bool enable)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
else if (m_rssWidget) {
|
||||
else {
|
||||
delete m_rssWidget;
|
||||
}
|
||||
}
|
||||
|
@ -714,7 +714,7 @@ void MainWindow::displaySearchTab(bool enable)
|
|||
tr("Search"));
|
||||
}
|
||||
}
|
||||
else if (m_searchWidget) {
|
||||
else {
|
||||
delete m_searchWidget;
|
||||
}
|
||||
}
|
||||
|
@ -1170,8 +1170,7 @@ void MainWindow::closeEvent(QCloseEvent *e)
|
|||
}
|
||||
|
||||
// abort search if any
|
||||
if (m_searchWidget)
|
||||
delete m_searchWidget;
|
||||
delete m_searchWidget;
|
||||
|
||||
hide();
|
||||
#ifndef Q_OS_MACOS
|
||||
|
@ -1875,7 +1874,7 @@ void MainWindow::on_actionExecutionLogs_triggered(bool checked)
|
|||
m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon("view-calendar-journal"));
|
||||
#endif
|
||||
}
|
||||
else if (m_executionLog) {
|
||||
else {
|
||||
delete m_executionLog;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue