aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/walkthrough.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/gui/walkthrough.cpp b/gui/walkthrough.cpp
index 080129a755..88052c7600 100644
--- a/gui/walkthrough.cpp
+++ b/gui/walkthrough.cpp
@@ -60,16 +60,18 @@ static int getNextWordLength(byte *src, int maxLength) {
bool WalkthroughDialog::loadWalkthroughText() {
char filename[260];
- File file;
+ File *file = new File();
sprintf(filename, "%s.wkt", _gameName);
- file.open(filename);
- if (!file.isOpen())
+ file->open(filename);
+ if (!file->isOpen())
return false;
- int bufferSize = file.size();
+ int bufferSize = file->size();
byte *buffer = (byte *)malloc(bufferSize);
- file.read(buffer, bufferSize);
- file.close();
+ file->read(buffer, bufferSize);
+ file->close();
+
+ delete file;
_linesArray.clear();