Forum > General

TFPGMap issue after upgrade to FPC 3.2.0

(1/4) > >>

antispam88:
Hi,

we are still using FPC 3.0.4 and Lazarus 2.0.8 (Win x86 + x64/Linux x64/Linux ARM) for our working projects.
Now we want to upgrade to the latest versions (FPC 3.2.0 + Lazarus 2.0.12).
After setting up the environment I had to adjust the code with some overload keywords which the new version claims.
Then to code compiled but failed regarding TFPGMap.
Freeing a map throws an "Access violation" in line 1561 of fgl.pp in the function DEREF.
I'm accessing the values using the Data property and copying items between maps using the Assign procedure.
I only found in the user changes of FPC 3.2.0 regarding FGL that the declaration of typ TTypeList has changed.
Does this cause our problems?

Here is an example of our map declaration:

--- 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";}};} ---typeITest = interface(IUnknown)function GetTestFunction: integer;end;TTestMap = specialize TFPGMap<string, ITest>;
We are looking forward to receive any hints or solutions.
Thx.

Best regards,
antispam88

jamie:
You need to pay closer attention to the error message..

That line number is pointing to the start of a finalize(TKey(item^)…… for which the Item, which is a pointer, could be NIL ? or in your case the string that TKEY is looking at could be NIL instead of pointing to a valid empty string and finalize is choking on it.

 The Error message should show an access violation at Address xxxxxx the address is important.


 or you found a bug in the compiler with the managed operators. Who knows.

egsuh:
Your data type is Interface, not any object. What if the interfaced object is not created?

PascalDragon:

--- Quote from: antispam88 on April 11, 2021, 11:28:59 pm ---We are looking forward to receive any hints or solutions.

--- End quote ---

Can you provide a more complete example?

antispam88:
As I mentioned in the first post, our code is working in 3.0.4/2.0.8 without any errors.
All interfaces are initialized.
My thought was that maybe someone has already come across this problem.

Unfortunately I can't post our company's project, but I try to create a demo project.
Best regards,
antispam88

Navigation

[0] Message Index

[#] Next page

Go to full version