9.2: ReadComplex on some nested structures produces an AV (C++Builder)

Hello,

I have been tracking an error with versión 9.2 that produced an AV on the server when reading some complex structures.

At the end it appears that the change made by RemObjects to use FreeAndNil instead of delete was the culprit, as changing those for the way they were used in version 9.1 solves the problem.

This is related to the other problem I reported on the last 9.2 beta, but that produced a compiler error, so it was impossible to miss. This one is more subtle, as there are some structures that can be read fine, but some others fail with this. I am not sure if I can provide a test case for this right now, but I wonder if with the following version this has been changed back to the way it was before? Or what’s the reason to use FreeAndNil, instead of delete?

Thanks

this issue was already fixed with beta and C++ Builder code again uses delete:

void __fastcall NewLibrary::NewStruct::ReadComplex(TObject* aSerializer)
{
..
	Binary* l_NewField;
..
		if (this->int_NewField != l_NewField)
			delete this->int_NewField;

or you mean that this code also generated some problems?

Hello Evgeny,

I haven’t tried any of the new builds available after the official 9.2 release. Changing versions is complex and being that they are labeled “Alpha” I assume there will be some problems. I would like to have time to beta test but as everybody, I am sure, time is scarce.

If you have already changed this and hopefully now everything compiles fine, then I can wait until you reach beta or something like that to install it here and try.

Thanks

Delphi/C++Builder side in this build contains some fixes only, including one for your issue.
.NET side contains a new feature so it was a reason why it was going to alpha