Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
rp- committed May 30, 2014
1 parent f8b2dd0 commit 040be65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Application::Application(int& argc, char** argv) :
#endif

// Load translations
m_translatorQt = new QTranslator();
m_translatorQt = new QTranslator(this);
m_translatorQt->load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
installTranslator(m_translatorQt);
m_translatorApp = new QTranslator();
m_translatorApp = new QTranslator(this);
m_translatorApp->load("tr_" + QLocale::system().name(), "translations");
installTranslator(m_translatorApp);

Expand Down Expand Up @@ -92,6 +92,11 @@ Application::Application(int& argc, char** argv) :
}
}

Application::~Application()
{
delete m_mainWindow;
}

bool Application::event(QEvent* event)
{
switch(event->type())
Expand Down
1 change: 1 addition & 0 deletions src/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Application : public QApplication

public:
explicit Application(int& argc, char** argv);
virtual ~Application();

bool dontShowMainWindow() { return m_dontShowMainWindow; }

Expand Down

0 comments on commit 040be65

Please sign in to comment.