aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/streams.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/streams.cpp')
-rw-r--r--engines/glk/streams.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp
index 801cd549a8..cd7130fb35 100644
--- a/engines/glk/streams.cpp
+++ b/engines/glk/streams.cpp
@@ -75,6 +75,10 @@ void Stream::setReverseVideo(bool reverse) {
/*--------------------------------------------------------------------------*/
+WindowStream::~WindowStream() {
+ _window->_stream = nullptr;
+}
+
void WindowStream::close(StreamResult *result) {
warning("cannot close window stream");
}
@@ -1407,8 +1411,10 @@ Streams::Streams() : _streamList(nullptr), _currentStream(nullptr) {
}
Streams::~Streams() {
- while (_streamList)
- delete _streamList;
+ for (Stream *currStream = _streamList, *nextStream; currStream; currStream = nextStream) {
+ nextStream = currStream->_next;
+ delete currStream;
+ }
}
FileStream *Streams::openFileStream(frefid_t fref, glui32 fmode, glui32 rock, bool unicode) {