From d9bcba0f17cf9a939153adf251ea1602f9ceeaa9 Mon Sep 17 00:00:00 2001 From: inikep Date: Tue, 17 Nov 2015 17:38:54 +0100 Subject: [PATCH] fixed: delete [] --- src/Common.cpp | 2 +- src/Decoder.cpp | 4 ++-- src/Encoder.cpp | 6 +++--- src/MemBuffer.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Common.cpp b/src/Common.cpp index 172e1df..e02041a 100644 --- a/src/Common.cpp +++ b/src/Common.cpp @@ -41,7 +41,7 @@ XWRT_Common::XWRT_Common(int fileBufferSize) : deleteInputFiles(false), WRT_verb XWRT_Common::~XWRT_Common() { if (word_hash) - delete(word_hash); + delete [] word_hash; WRT_deinitialize(); diff --git a/src/Decoder.cpp b/src/Decoder.cpp index 29cf335..a9dd186 100644 --- a/src/Decoder.cpp +++ b/src/Decoder.cpp @@ -22,10 +22,10 @@ XWRT_Decoder::XWRT_Decoder() : utf8pos(0), WRTd_s(&WRTd_data[0]) XWRT_Decoder::~XWRT_Decoder() { if (putcBuffer) - delete(putcBuffer); + delete [] putcBuffer; if (zlibBuffer) - delete(zlibBuffer); + delete [] zlibBuffer; } #define WRITE_CHAR(c)\ diff --git a/src/Encoder.cpp b/src/Encoder.cpp index 38e5160..9067443 100644 --- a/src/Encoder.cpp +++ b/src/Encoder.cpp @@ -31,10 +31,10 @@ XWRT_Encoder::XWRT_Encoder() : utf8cached(0), utf8pos(0), last_c_bak(0) XWRT_Encoder::~XWRT_Encoder() { if (getcBuffer) - delete(getcBuffer); + delete [] getcBuffer; if (zlibBuffer) - delete(zlibBuffer); + delete [] zlibBuffer; } #define ENCODE_PUTC(c)\ @@ -2888,7 +2888,7 @@ void XWRT_Encoder::sortDict(int size) sortedDict.push_back(str); } - delete(inttable); + delete [] inttable; } diff --git a/src/MemBuffer.cpp b/src/MemBuffer.cpp index a9fbdab..6ccd012 100644 --- a/src/MemBuffer.cpp +++ b/src/MemBuffer.cpp @@ -251,7 +251,7 @@ void CContainers::writeMemBuffers(int preprocFlag, int PPMDlib_order, int comprL int count; count=(int)memmap.size(); - Size=new unsigned size_t[count]; + Size=new size_t[count]; Data=(unsigned char**) malloc(sizeof(unsigned char*)*count); if (Data==NULL) OUT_OF_MEMORY();