File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ namespace claujson {
207
207
}
208
208
~Vector () {
209
209
if (type == 1 && ptr) {
210
- delete ptr;
210
+ delete[] ptr;
211
211
ptr = nullptr ;
212
212
sz = 0 ;
213
213
type = 0 ;
@@ -249,7 +249,7 @@ namespace claujson {
249
249
public:
250
250
void clear () {
251
251
if (type == 1 && ptr) {
252
- delete ptr;
252
+ delete[] ptr;
253
253
ptr = nullptr ;
254
254
}
255
255
capacity = SIZE;
@@ -282,7 +282,7 @@ namespace claujson {
282
282
++sz;
283
283
if (sz == SIZE) {
284
284
if (ptr) {
285
- delete ptr; ptr = nullptr ;
285
+ delete[] ptr; ptr = nullptr ;
286
286
}
287
287
ptr = new (std::nothrow) T[SIZE * 2 ];
288
288
if (!ptr) {
@@ -305,7 +305,7 @@ namespace claujson {
305
305
}
306
306
memcpy (temp, ptr, sz * sizeof (T));
307
307
capacity = capacity * 2 ;
308
- delete ptr;
308
+ delete[] ptr;
309
309
ptr = temp;
310
310
ptr[sz] = std::move (val);
311
311
++sz;
You can’t perform that action at this time.
0 commit comments