]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fileback.cpp
Applied #15375 to stop event-sending in generic wxSpinCtrl ctor (eco)
[wxWidgets.git] / src / common / fileback.cpp
index 6e4253c0f76896fa8684a6ecee8724c5a603e4a4..c9c6c49476bda3d356a61d9d36455b23e17eb83a 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/common/fileback.cpp
 // Purpose:     Back an input stream with memory or a file
 // Author:      Mike Wetherell
-// RCS-ID:      $Id$
 // Copyright:   (c) 2006 Mike Wetherell
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -168,11 +167,9 @@ wxStreamError wxBackingFileImpl::ReadAt(wxFileOffset pos,
                     m_filelen += count;
 
                     if (count < m_buflen) {
-                        delete m_stream;
-                        m_stream = NULL;
+                        wxDELETE(m_stream);
                         if (count > 0) {
-                            delete[] m_buf;
-                            m_buf = NULL;
+                            wxDELETEA(m_buf);
                             m_buflen = 0;
                         }
                         m_parenterror = wxSTREAM_READ_ERROR;
@@ -182,8 +179,7 @@ wxStreamError wxBackingFileImpl::ReadAt(wxFileOffset pos,
                     m_buflen = 0;
 
                     if (!m_stream) {
-                        delete[] m_buf;
-                        m_buf = NULL;
+                        wxDELETEA(m_buf);
                     }
                 }
 
@@ -197,8 +193,7 @@ wxStreamError wxBackingFileImpl::ReadAt(wxFileOffset pos,
                     m_parenterror = m_stream->GetLastError();
                     if (m_parenterror == wxSTREAM_NO_ERROR)
                         m_parenterror = wxSTREAM_EOF;
-                    delete m_stream;
-                    m_stream = NULL;
+                    wxDELETE(m_stream);
                 }
             }
 
@@ -293,7 +288,7 @@ wxFileOffset wxBackedInputStream::FindLength() const
 
     return len;
 }
-    
+
 size_t wxBackedInputStream::OnSysRead(void *buffer, size_t size)
 {
     if (!IsOk())