Skip to content

Commit 41fecce

Browse files
authored
Matched delete operator with the assignment. Fixes #131. (#132)
1 parent 38721a9 commit 41fecce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

FEBioPlot/PltArchive.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class OLeaf<T*> : public OChunk
168168
memcpy(m_pd, pd, sizeof(T)*nsize);
169169
m_nsize = nsize;
170170
}
171-
~OLeaf() { delete m_pd; }
171+
~OLeaf() { delete[] m_pd; }
172172

173173
int Size() { return sizeof(T)*m_nsize; }
174174
void Write(FileStream* fp)
@@ -194,7 +194,7 @@ class OLeaf<const char*> : public OChunk
194194
m_psz = new char[l+1];
195195
memcpy(m_psz, sz, l+1);
196196
}
197-
~OLeaf() { delete m_psz; }
197+
~OLeaf() { delete[] m_psz; }
198198

199199
int Size() { return (int)strlen(m_psz)+sizeof(int); }
200200
void Write(FileStream* fp)
@@ -224,7 +224,7 @@ class OLeaf<std::vector<T> > : public OChunk
224224
memcpy(m_pd, &a[0], sizeof(T) * m_nsize);
225225
}
226226
}
227-
~OLeaf() { delete m_pd; }
227+
~OLeaf() { delete[] m_pd; }
228228

229229
int Size() { return sizeof(T)*m_nsize; }
230230
void Write(FileStream* fp)

0 commit comments

Comments
 (0)