From 1da2e7154cc1b255b0c763326632b318d997c4c6 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Mon, 11 Aug 2014 10:08:33 +0200 Subject: [PATCH] Fixed Valgrind warnings Running cockatrice in valgrind i didn't found any bad memory leak (good!), but only a few jumps depending on uninitialized variables. Even if the possibility of crashes are remote, it's nice to sort them out. --- cockatrice/src/gamesmodel.cpp | 1 + cockatrice/src/messagelogwidget.cpp | 2 +- cockatrice/src/phasestoolbar.cpp | 2 +- cockatrice/src/tab_game.cpp | 1 + common/server_response_containers.cpp | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index 9dd7185d..df0ec880 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -93,6 +93,7 @@ GamesProxyModel::GamesProxyModel(QObject *parent, ServerInfo_User *_ownUser) : QSortFilterProxyModel(parent), ownUser(_ownUser), unavailableGamesVisible(false), + passwordProtectedGamesVisible(false), maxPlayersFilterMin(-1), maxPlayersFilterMax(-1) { diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index d40b1068..a25a3cd0 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -876,6 +876,6 @@ void MessageLogWidget::connectToPlayer(Player *player) } MessageLogWidget::MessageLogWidget(const TabSupervisor *_tabSupervisor, TabGame *_game, QWidget *parent) - : ChatView(_tabSupervisor, _game, false, parent) + : ChatView(_tabSupervisor, _game, false, parent), currentContext(MessageContext_None) { } diff --git a/cockatrice/src/phasestoolbar.cpp b/cockatrice/src/phasestoolbar.cpp index b34872f6..9b22f611 100644 --- a/cockatrice/src/phasestoolbar.cpp +++ b/cockatrice/src/phasestoolbar.cpp @@ -100,7 +100,7 @@ void PhaseButton::triggerDoubleClickAction() } PhasesToolbar::PhasesToolbar(QGraphicsItem *parent) - : QGraphicsItem(parent), width(100), height(100) + : QGraphicsItem(parent), width(100), height(100), ySpacing(1), symbolSize(8) { QAction *aUntapAll = new QAction(this); connect(aUntapAll, SIGNAL(triggered()), this, SLOT(actUntapAll())); diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index 715c75f7..69d61925 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -236,6 +236,7 @@ void DeckViewContainer::setDeck(const DeckLoader &deck) TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) : Tab(_tabSupervisor), + secondsElapsed(0), hostId(-1), localPlayerId(-1), spectator(true), diff --git a/common/server_response_containers.cpp b/common/server_response_containers.cpp index 0c95e537..e327ee9d 100644 --- a/common/server_response_containers.cpp +++ b/common/server_response_containers.cpp @@ -15,7 +15,7 @@ GameEventStorageItem::~GameEventStorageItem() } GameEventStorage::GameEventStorage() - : gameEventContext(0) + : gameEventContext(0), privatePlayerId(0) { }