这个函数是循环的。当我运行程序时,带有 IntPtr 的行给我带来了内存问题,我已经把 delete[],但它仍然没有解决内存问题,有人可以帮忙吗?谢谢
void showImage(IplImage *img,System::Windows::Forms::PictureBox^ picturebox)
{
IntPtr ip(new unsigned char[img->widthStep*img->height]); // this line causing memory usage to keep going up very fast
//memcpy(ip.ToPointer(),img->imageData,img->widthStep*img->height);
//picturebox->Image = gcnew Bitmap(img->width,img->height, img->widthStep, System:rawing::Imaging::PixelFormat::Format24bppRgb, ip);
delete[] ip;
}
这是 C++\CLI