Skip to content

Commit

Permalink
Dont risk returning internals of a temporary string
Browse files Browse the repository at this point in the history
  • Loading branch information
vkholodkov committed Jun 5, 2014
1 parent 86aedc6 commit 26970f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion QtClient/mainwindow.cpp
Expand Up @@ -307,7 +307,9 @@ void MainWindow::loadPlayerFile(const QString &fileName)
TheGalaxy = new Galaxy;

try {
if(!TheGame->LoadPlayerFile(fileName.toAscii().data())) {
std::string filename_ascii(fileName.toAscii());

if(!TheGame->LoadPlayerFile(filename_ascii.c_str())) {
QMessageBox::warning(this, tr("Application"),
tr("Cannot open player file %1")
.arg(fileName));
Expand Down

0 comments on commit 26970f1

Please sign in to comment.