diff --git a/2.10/Source/BucketFillerThread.pas b/2.10/Source/BucketFillerThread.pas index f9f0349..97f541e 100644 --- a/2.10/Source/BucketFillerThread.pas +++ b/2.10/Source/BucketFillerThread.pas @@ -31,11 +31,13 @@ type implementation +//uses SysUtils, FormRender; + /////////////////////////////////////////////////////////////////////////////// constructor TBucketFillerThread.Create(cp: TControlPoint); begin inherited Create(True); - Self.FreeOnTerminate := True; + //Self.FreeOnTerminate := True; Fcp := cp.Clone; @@ -58,6 +60,7 @@ var bc: integer; begin inherited; + //RenderForm.Output.Lines.Add(' . . . > Filler thread #' + IntToStr(ThreadID) + ' Started'); bc := 0; while (not Terminated) and (bc < Nrbatches) do begin @@ -74,6 +77,7 @@ begin LeaveCriticalSection(CriticalSection); end; end; + //RenderForm.Output.Lines.Add(' . . . > Filler thread #' + IntToStr(ThreadID) + ' Finished'); end; /////////////////////////////////////////////////////////////////////////////// diff --git a/2.10/Source/RenderMT.pas b/2.10/Source/RenderMT.pas index 8ec47bf..5d830b0 100644 --- a/2.10/Source/RenderMT.pas +++ b/2.10/Source/RenderMT.pas @@ -104,6 +104,8 @@ begin for i := 0 to High(WorkingThreads) do begin WorkingThreads[i].Terminate; + WorkingThreads[i].WaitFor; + WorkingThreads[i].Free; end; SetLength(WorkingThreads, 0); @@ -128,7 +130,7 @@ var begin for i := 0 to High(WorkingThreads) do WorkingThreads[i].Terminate; - SetLength(WorkingThreads, 0); //? + //SetLength(WorkingThreads, 0); //? inherited; // FStop := 1; end; @@ -143,7 +145,7 @@ begin for i := 0 to High(WorkingThreads) do WorkingThreads[i].Terminate; - SetLength(WorkingThreads, 0); //? + //SetLength(WorkingThreads, 0); //? end; procedure TBaseMTRenderer.Pause; @@ -167,11 +169,11 @@ begin end; procedure TBaseMTRenderer.SetThreadPriority(p: TThreadPriority); -var - i: integer; +//var +// i: integer; begin inherited; - + //for i := 0 to High(WorkingThreads) do // WorkingThreads[i].Priority := p; end; @@ -181,7 +183,7 @@ function TBaseMTRenderer.NewThread: TBucketFillerThread; begin Result := TBucketFillerThread.Create(fcp); assert(Result<>nil); - //Result.Priority := FThreadPriority; + Result.Priority := tpLower; //FThreadPriority; if FCP.FAngle = 0 then Result.AddPointsProc := self.AddPointsToBuckets