mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-28 11:53:11 -07:00
[Game] Fix crash by properly parenting QObjects (#6788)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#include "abstract_game.h"
|
||||
|
||||
#include "../interface/widgets/tabs/tab_game.h"
|
||||
#include "player/player.h"
|
||||
|
||||
AbstractGame::AbstractGame(TabGame *_tab) : tab(_tab)
|
||||
AbstractGame::AbstractGame(TabGame *_tab) : QObject(_tab), tab(_tab)
|
||||
{
|
||||
gameMetaInfo = new GameMetaInfo(this);
|
||||
gameEventHandler = new GameEventHandler(this);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <libcockatrice/protocol/pb/command_reveal_cards.pb.h>
|
||||
|
||||
PlayerMenu::PlayerMenu(Player *_player) : player(_player)
|
||||
PlayerMenu::PlayerMenu(Player *_player) : QObject(_player), player(_player)
|
||||
{
|
||||
playerMenu = new TearOffMenu();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ private slots:
|
||||
void refreshShortcuts();
|
||||
|
||||
public:
|
||||
PlayerMenu(Player *player);
|
||||
explicit PlayerMenu(Player *player);
|
||||
/// Lifecycle methods: delegate to all managedComponents, plus counters separately via player->getCounters().
|
||||
void retranslateUi();
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
// milliseconds in between triggers of the move top cards until action
|
||||
static constexpr int MOVE_TOP_CARD_UNTIL_INTERVAL = 100;
|
||||
|
||||
PlayerActions::PlayerActions(Player *_player) : player(_player), lastTokenTableRow(0), movingCardsUntil(false)
|
||||
PlayerActions::PlayerActions(Player *_player)
|
||||
: QObject(_player), player(_player), lastTokenTableRow(0), movingCardsUntil(false)
|
||||
{
|
||||
moveTopCardTimer = new QTimer(this);
|
||||
moveTopCardTimer->setInterval(MOVE_TOP_CARD_UNTIL_INTERVAL);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <libcockatrice/protocol/pb/event_shuffle.pb.h>
|
||||
#include <libcockatrice/utility/zone_names.h>
|
||||
|
||||
PlayerEventHandler::PlayerEventHandler(Player *_player) : player(_player)
|
||||
PlayerEventHandler::PlayerEventHandler(Player *_player) : QObject(_player), player(_player)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user