此功能處於循環狀態。當我運行程序時,與IntPtr的行給我內存問題,我已經把刪除[],但它仍然不能解決內存問題,任何人都可以幫忙嗎?感謝IntPtr導致內存泄漏?
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
你至少能說出這是什麼語言和平臺? – 2011-04-09 19:35:55
是啊,這是C++ \ cli – Qmage 2011-04-09 19:38:40
什麼*內存問題*? – 2011-04-09 19:39:48