Skip to content

Commit

Permalink
fix: Fixed a memory leak issue in actiondefs.cpp.
Browse files Browse the repository at this point in the history
in actiondefs.cpp:80 "actionList = new QList<QAction*>", the actionList not delete.
  • Loading branch information
GongHeng2017 committed Jun 16, 2021
1 parent 3dc5579 commit c8a5ffd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fm/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@ MainWindow::MainWindow()

QTimer::singleShot(0, this, SLOT(lateStart()));
}

MainWindow::~MainWindow()
{
if (actionList) {
qDeleteAll(*actionList);
actionList->clear();
delete actionList;
actionList = nullptr;
}
}
//---------------------------------------------------------------------------

/**
Expand Down
1 change: 1 addition & 0 deletions fm/src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class MainWindow : public QMainWindow

public:
MainWindow();
~MainWindow();
myModel *modelList;

protected:
Expand Down

0 comments on commit c8a5ffd

Please sign in to comment.