diff options
| author | 2020-09-29 16:22:50 -0300 | |
|---|---|---|
| committer | 2020-09-29 16:23:16 -0300 | |
| commit | ae6df703f5e15548b7dd076d5763adee547d6444 (patch) | |
| tree | a69fb3241502764a0c473dcf71f09ff82884c667 | |
| parent | Merge pull request #4721 from lioncash/genfn (diff) | |
| download | yuzu-ae6df703f5e15548b7dd076d5763adee547d6444.tar.gz yuzu-ae6df703f5e15548b7dd076d5763adee547d6444.tar.xz yuzu-ae6df703f5e15548b7dd076d5763adee547d6444.zip | |
qt/game_list: Give GameListSearchField::KeyReleaseEater a parent
This fixes a memory leak as KeyReleaseEater's destructor was never
called.
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/game_list.cpp | 5 | ||||
| -rw-r--r-- | src/yuzu/game_list_p.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index a9738e298..70d865112 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -25,7 +25,8 @@ | |||
| 25 | #include "yuzu/main.h" | 25 | #include "yuzu/main.h" |
| 26 | #include "yuzu/uisettings.h" | 26 | #include "yuzu/uisettings.h" |
| 27 | 27 | ||
| 28 | GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist) : gamelist{gamelist} {} | 28 | GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist, QObject* parent) |
| 29 | : QObject(parent), gamelist{gamelist} {} | ||
| 29 | 30 | ||
| 30 | // EventFilter in order to process systemkeys while editing the searchfield | 31 | // EventFilter in order to process systemkeys while editing the searchfield |
| 31 | bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) { | 32 | bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) { |
| @@ -116,7 +117,7 @@ void GameListSearchField::setFocus() { | |||
| 116 | } | 117 | } |
| 117 | 118 | ||
| 118 | GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} { | 119 | GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} { |
| 119 | auto* const key_release_eater = new KeyReleaseEater(parent); | 120 | auto* const key_release_eater = new KeyReleaseEater(parent, this); |
| 120 | layout_filter = new QHBoxLayout; | 121 | layout_filter = new QHBoxLayout; |
| 121 | layout_filter->setMargin(8); | 122 | layout_filter->setMargin(8); |
| 122 | label_filter = new QLabel; | 123 | label_filter = new QLabel; |
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 92779a9c7..248855aff 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -330,7 +330,7 @@ public: | |||
| 330 | private: | 330 | private: |
| 331 | class KeyReleaseEater : public QObject { | 331 | class KeyReleaseEater : public QObject { |
| 332 | public: | 332 | public: |
| 333 | explicit KeyReleaseEater(GameList* gamelist); | 333 | explicit KeyReleaseEater(GameList* gamelist, QObject* parent = nullptr); |
| 334 | 334 | ||
| 335 | private: | 335 | private: |
| 336 | GameList* gamelist = nullptr; | 336 | GameList* gamelist = nullptr; |