Hello,
I have 2 threads which runs at the same time every x minutes.
Every now and then both processes just stop.
After many test I think have managed to find where it happens.
It seems it happens when I create the components. In fact each thread does this:
TmpDM := TDataModule.Create(AOwner);
iev_IN := TImageEnView.Create(tmpDM);
iev_IN2 := TImageEnView.Create(tmpDM);
iemv_OUT := TImageEnMView.Create(tmpDM);
I have managed to solve it by doing this:
ImageEN_Lock1.Acquire;
TmpDM := TDataModule.Create(AOwner);
iev_IN := TImageEnView.Create(tmpDM);
iev_IN2 := TImageEnView.Create(tmpDM);
iemv_OUT := TImageEnMView.Create(tmpDM);
ImageEN_Lock1.Release;
However I am not sure why it happens.
Could you help me?
To test it, I created 2 threads which runs every second. After 2-3 minutes it happens.
Thank you.