[Scummvm-git-logs] scummvm master -> d86bb46a85197fc75d82dbb97f8d541107e51ca1

eriktorbjorn eriktorbjorn at telia.com
Thu Feb 28 20:16:31 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d86bb46a85 GLK: Use delete[] instead of free() to free _lineTerminators


Commit: d86bb46a85197fc75d82dbb97f8d541107e51ca1
    https://github.com/scummvm/scummvm/commit/d86bb46a85197fc75d82dbb97f8d541107e51ca1
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2019-02-28T19:58:54+01:00

Commit Message:
GLK: Use delete[] instead of free() to free _lineTerminators

Changed paths:
    engines/glk/window_text_buffer.cpp
    engines/glk/window_text_grid.cpp


diff --git a/engines/glk/window_text_buffer.cpp b/engines/glk/window_text_buffer.cpp
index b27fb36..788f8ca 100644
--- a/engines/glk/window_text_buffer.cpp
+++ b/engines/glk/window_text_buffer.cpp
@@ -1446,7 +1446,7 @@ void TextBufferWindow::acceptLine(uint32 keycode) {
 			_echoLineInput = false;
 
 		g_vm->_events->store(evtype_LineInput, this, len, keycode);
-		free(_lineTerminators);
+		delete[] _lineTerminators;
 		_lineTerminators = nullptr;
 	} else {
 		g_vm->_events->store(evtype_LineInput, this, len, 0);
diff --git a/engines/glk/window_text_grid.cpp b/engines/glk/window_text_grid.cpp
index 971d35a..be09725 100644
--- a/engines/glk/window_text_grid.cpp
+++ b/engines/glk/window_text_grid.cpp
@@ -370,7 +370,7 @@ void TextGridWindow::cancelLineEvent(Event *ev) {
 	_lineRequestUni = false;
 
 	if (_lineTerminators) {
-		free(_lineTerminators);
+		delete[] _lineTerminators;
 		_lineTerminators = nullptr;
 	}
 
@@ -443,7 +443,7 @@ void TextGridWindow::acceptLine(uint32 keycode) {
 		if (val2 == keycode_Return)
 			val2 = 0;
 		g_vm->_events->store(evtype_LineInput, this, _inLen, val2);
-		free(_lineTerminators);
+		delete[] _lineTerminators;
 		_lineTerminators = nullptr;
 	} else {
 		g_vm->_events->store(evtype_LineInput, this, _inLen, 0);





More information about the Scummvm-git-logs mailing list