Why using "delete" instead of "delete []" to delete mask array pointer?

In function InferPostprocessor::releaseFrameOutput(NvDsInferFrameOutput& frameOutput):

case NvDsInferNetworkType_InstanceSegmentation:
...
  delete frameOutput.detectionOutput.objects[j].mask;
...

And mask is initialize as :

float *mask = (float *)g_malloc(obj.mask_size);

So mask is a pointer to an array, which need to be released by using delete []

Mask in struct NvDsInferObject is assumably an array of float. It’s probably allocated by either new [mask_size] or malloc(mask_size). So it should be deallocated by delete [] or free. Not sure why in deepstream implementation it uses delete.

Seems mismatch between allocation and free. We will check it. Thanks for reporting it.

1 Like

@kesong any updates on this?

We will fix it in the following release of Deepstream. Thanks for reporting the issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.