I'm using Delphi Rio. I have created a thread class.
type
TThreadManager = class(TThread)
constructor Create;
end;
constructor TThreadManager.Create;
begin
inherited Create(True); // thread-ul va fi creat, dar nu va rula
// pentru a-l rula, folosim "Resume" (sau "Execute")
FreeOnTerminate := True; // thread-ul va fi distrus automat cand termina
Priority := tpNormal; // prioritatea thread-ului este minima
<- creating internal objects here
fIsSetupOk := False;
end;
However (this) constructor is not used when I create the thread in the application. No debug breakpoints are available. And also no objects are created.
threadManager := TThreadManager.Create;
threadManager.Setup(dmMain.ibSessionMain);
threadManager.Resume;
Because of not entering this constructor, an AV is raised when accessing the objects.
Any hints?
Sure, I can create the objects elsewhere (into the setup) but that is not what I want.
TThreadManagerand choose "Find declaration" - do you really see the code you expect or is it a different one? Also tryTheUnitName.TThreadManager.Createto make it unambiguous.