mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-26 17:12:37 -06:00
qt/game_list: Give GameListSearchField::KeyReleaseEater a parent
This fixes a memory leak as KeyReleaseEater's destructor was never called. Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
This commit is contained in:
parent
aced133a3d
commit
e12ee55faa
2 changed files with 4 additions and 3 deletions
|
@ -32,7 +32,8 @@
|
|||
#include "core/file_sys/archive_source_sd_savedata.h"
|
||||
#include "core/hle/service/fs/archive.h"
|
||||
|
||||
GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist) : gamelist{gamelist} {}
|
||||
GameListSearchField::KeyReleaseEater::KeyReleaseEater(GameList* gamelist, QObject* parent)
|
||||
: QObject(parent), gamelist{gamelist} {}
|
||||
|
||||
// EventFilter in order to process systemkeys while editing the searchfield
|
||||
bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) {
|
||||
|
@ -128,7 +129,7 @@ void GameListSearchField::setFocus() {
|
|||
}
|
||||
|
||||
GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} {
|
||||
auto* const key_release_eater = new KeyReleaseEater(parent);
|
||||
auto* const key_release_eater = new KeyReleaseEater(parent, this);
|
||||
layout_filter = new QHBoxLayout;
|
||||
layout_filter->setMargin(8);
|
||||
label_filter = new QLabel;
|
||||
|
|
|
@ -432,7 +432,7 @@ public:
|
|||
private:
|
||||
class KeyReleaseEater : public QObject {
|
||||
public:
|
||||
explicit KeyReleaseEater(GameList* gamelist);
|
||||
explicit KeyReleaseEater(GameList* gamelist, QObject* parent = nullptr);
|
||||
|
||||
private:
|
||||
GameList* gamelist = nullptr;
|
||||
|
|
Loading…
Reference in a new issue