Re: [問題] 使用cvLoadImage後無法關閉BCB的程式
我自己找到原因了 OpenCv 1.1版不能使用TDialog+cvLoadImage
會造成程式無法關閉 我改用OpenCv 1.0就沒有這個問題
※ 引述《b90343024 ()》之銘言:
: 小弟最近用opencv+BCB6寫專案程式 最近發現把Form關閉後
: 程式還是在工作管理員上出現只能強制關閉
: 一行一行找bug後發現cvLoadImage好像會有memory leak的問題
: 所以寫了簡單的程式測測看 結果還真的關不掉
: 想說記憶體流失就算了 問看看有沒有可以從程式中關閉的方法
: ---------------------------測試程式------------------------------
: #include <vcl.h>
: #pragma hdrstop
: #include "cv.h"
: #include "highgui.h"
: #include "Unit1.h"
: #pragma package(smart_init)
: #pragma resource "*.dfm"
: TForm1 *Form1;
: __fastcall TForm1::TForm1(TComponent* Owner)
: : TForm(Owner)
: {
: }
: void __fastcall TForm1::Button1Click(TObject *Sender)
: {
: TOpenDialog * OpenDataDialog1 = new TOpenDialog(this);
: if(OpenDataDialog1->Execute())
: {
: IplImage * Img = cvLoadImage("C:\1234.jpg",CV_LOAD_IMAGE_COLOR);
: cvReleaseImage(&Img);
: }
: delete OpenDataDialog1;
: }
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.110.102.167
→
10/15 11:46, , 1F
10/15 11:46, 1F
推
10/15 12:40, , 2F
10/15 12:40, 2F
→
10/15 13:46, , 3F
10/15 13:46, 3F
→
10/15 15:32, , 4F
10/15 15:32, 4F
推
10/15 18:06, , 5F
10/15 18:06, 5F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):