The memory leaking in the object recognition program has not been solved. Today, i changed the developing software from Code:Blocks to Visual Studio which is better for debugging. However, there generated a new problem, the debugging window said:
First-chance exception at 0x7c90eb74 in camera1.7.exe: 0xC0000008: An invalid handle was specified.
And, the debugging pointer was on the left side of the code:
capture = cvCaptureFromCAM(0);
Well, this line ran smoothly in Code:Blocks, why at here it went wrong.