From c64d1e855b39bfcaf984340fe690efe48a9dec4e Mon Sep 17 00:00:00 2001 From: Ronald Reagan Date: Thu, 30 Jan 2014 17:21:35 -0800 Subject: [PATCH] Console history save fixes --- source/src/console.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/src/console.cpp b/source/src/console.cpp index eee89a7a..70ed7811 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -481,6 +481,7 @@ void savehistory() { loopv(history) { f->printf("%s\n",history[i]->buf); } + delete f; } void loadhistory() { @@ -488,9 +489,10 @@ void loadhistory() { char *line = NULL; line = strtok(histbuf, "\n"); while (line) { - history.add(new hline)->buf = line; + history.add(new hline)->buf = newstring(line); line = strtok(NULL, "\n"); } + DELETEA(histbuf); histpos = history.length(); }