diff --git a/dic/stacktrace.cpp b/dic/stacktrace.cpp index 6c95772..4c73745 100644 --- a/dic/stacktrace.cpp +++ b/dic/stacktrace.cpp @@ -54,6 +54,7 @@ string StackTrace::GetStack() { oss << " at " << Demangle(symbols[i]) << endl; } + free (symbols); return oss.str(); #else diff --git a/qt/main_window.cpp b/qt/main_window.cpp index 4d85a16..5a0f0a5 100644 --- a/qt/main_window.cpp +++ b/qt/main_window.cpp @@ -118,13 +118,13 @@ MainWindow::MainWindow(QWidget *iParent) // Status bar statusBar()->addWidget(new QLabel, 1); // First widget, not added yet - m_lettersLabel = new QLabel; + m_lettersLabel = new QLabel(statusBar()); m_lettersLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); // Second widget, not added yet - m_turnLabel = new QLabel; + m_turnLabel = new QLabel(statusBar()); m_turnLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); // Third widget - m_dicNameLabel = new QLabel; + m_dicNameLabel = new QLabel(this); m_dicNameLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); statusBar()->addPermanentWidget(m_dicNameLabel); QObject::connect(this, SIGNAL(dicChanged(const Dictionary*)), @@ -202,6 +202,10 @@ MainWindow::~MainWindow() delete m_game; delete m_dic; delete m_timerModel; + + // Destroy singletons + GameFactory::Destroy(); + Settings::Destroy(); } diff --git a/utils/eliottxt.cpp b/utils/eliottxt.cpp index af8e6ee..1943105 100644 --- a/utils/eliottxt.cpp +++ b/utils/eliottxt.cpp @@ -76,6 +76,15 @@ wchar_t *rl_gets() delete[] wline_read; } + static bool init = true; + if (init) + { + // Initialize readline() explicitly, to help filtering + // valgrind results + rl_initialize(); + init = false; + } + // Get a line from the user static char *line_read; line_read = readline("commande> "); @@ -944,6 +953,7 @@ int main(int argc, char *argv[]) mainLoop(dic); GameFactory::Destroy(); + Settings::Destroy(); // Free the readline static variable if (wline_read)