Laex / Delphi-OpenCV

Project Delphi-OpenCV. Translation of OpenCV library header files in Delphi
500 stars 226 forks source link

Bug in TocvCameraSource.SetEnabled(Value: Boolean); ocv.comp.source #97

Closed HuguesDug closed 5 years ago

HuguesDug commented 6 years ago

Hello,

Here it is a real bug I found, while having a coding problem.

When you do TocvCameraSource.SetEnabled(Value: Boolean); (while changing the enabled property) with no camera connected... the state will go to enabled, but the thread will not run and you will not receive any error. So, your program will wait for ever.

The problem lies here: You have a FEnabled := Value; line 385, end of the procedure.

In fact, you should have to steps to assign values:

if FCapture not assigned, you should not change this Fenabled because it leads to problem.

The problem may as well exist for other source components with enable status.