From ba0b7b323817e44903ba5ee199d17bbb166ed3d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 22 Aug 2001 22:13:22 +0000 Subject: [PATCH] fixed yet another bug in wxStream classes (This time, the braindead wannabe coder who wrote the original code created wxStreamBase instance and then casted it to wxInputStream and hapilly used the stream, which could of course never work. Anybody knows a cheap hitman?) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/stream.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/stream.cpp b/src/common/stream.cpp index 9c006b8f7a..a65c6154d8 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -95,7 +95,14 @@ wxStreamBuffer::wxStreamBuffer(BufMode mode) { Init(); - m_stream = new wxStreamBase; + wxASSERT_MSG(mode != read_write, wxT("you have to use the other ctor for read_write mode") ); + if ( mode == read ) + m_stream = new wxInputStream; + else if ( mode == write) + m_stream = new wxOutputStream; + else + m_stream = NULL; + m_mode = mode; m_flushable = FALSE; -- 2.47.2