mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-01 12:57:52 +00:00
qt/game_list: Give GameListSearchField::KeyReleaseEater a parent
This fixes a memory leak as KeyReleaseEater's destructor was never called.
This commit is contained in:
parent
09609dd50e
commit
ae6df703f5
2 changed files with 4 additions and 3 deletions
|
@ -25,7 +25,8 @@
|
||||||
#include "yuzu/main.h"
|
#include "yuzu/main.h"
|
||||||
#include "yuzu/uisettings.h"
|
#include "yuzu/uisettings.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
|
// EventFilter in order to process systemkeys while editing the searchfield
|
||||||
bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) {
|
bool GameListSearchField::KeyReleaseEater::eventFilter(QObject* obj, QEvent* event) {
|
||||||
|
@ -116,7 +117,7 @@ void GameListSearchField::setFocus() {
|
||||||
}
|
}
|
||||||
|
|
||||||
GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} {
|
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 = new QHBoxLayout;
|
||||||
layout_filter->setMargin(8);
|
layout_filter->setMargin(8);
|
||||||
label_filter = new QLabel;
|
label_filter = new QLabel;
|
||||||
|
|
|
@ -330,7 +330,7 @@ public:
|
||||||
private:
|
private:
|
||||||
class KeyReleaseEater : public QObject {
|
class KeyReleaseEater : public QObject {
|
||||||
public:
|
public:
|
||||||
explicit KeyReleaseEater(GameList* gamelist);
|
explicit KeyReleaseEater(GameList* gamelist, QObject* parent = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GameList* gamelist = nullptr;
|
GameList* gamelist = nullptr;
|
||||||
|
|
Loading…
Reference in a new issue