Skip to content

Commit

Permalink
fixed: delete []
Browse files Browse the repository at this point in the history
  • Loading branch information
inikep committed Nov 17, 2015
1 parent 549f79e commit d9bcba0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)\
Expand Down
6 changes: 3 additions & 3 deletions src/Encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)\
Expand Down Expand Up @@ -2888,7 +2888,7 @@ void XWRT_Encoder::sortDict(int size)
sortedDict.push_back(str);
}

delete(inttable);
delete [] inttable;
}


Expand Down
2 changes: 1 addition & 1 deletion src/MemBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d9bcba0

Please sign in to comment.