Forum > FPC development

TDeque issue on MacOS Arm M1

(1/4) > >>

powerpcer:
TDeque.ClearData; this method should change to this

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TDeque.ClearData;var  i: SizeUint;begin  if IsManagedType(T) then    if FData <> nil then //<--add checking, else When FData is nil(why not happen on Windows?)    for i := Low(FData) to High(FData) do      Finalize(FData[i]);  FillChar(FData[Low(FData)], SizeUInt(Length(FData))*SizeOf(T), 0);end;  

Bart:
Please file a bugreport on the FPC issue tracker.

Bart

AlexTP:
I don't get your idea, how macOS can be 'bad' here and Windows can be ok here? Code is crossplatform! Show the failing small project.

PascalDragon:

--- Quote from: powerpcer on December 13, 2021, 07:30:44 am ---TDeque.ClearData; this method should change to this
--- End quote ---

Please provide a complete example that fails.

powerpcer:

--- Quote from: Alextp on December 13, 2021, 12:30:40 pm ---I don't get your idea, how macOS can be 'bad' here and Windows can be ok here? Code is crossplatform! Show the failing small project.

--- End quote ---
i just build your old version CudaText 1.95.x , it work!!
but when the App close in the FormDestroy of FormMain, the freeandnil(FconsoleQueue) report me access violation.
and follow the debugger, it show me Fdata on TDeque.ClearData is Nil, and Low(Fdata) to High(Fdata) work, so Finalize(Fdata) got access violation.
my FPC version is 3.2.2 come from FPCDeluxe project.

Navigation

[0] Message Index

[#] Next page

Go to full version