AV on Template.LoadfromStream with latest version (4.92) of FASTMM MemoryManager
Hi,
We use RB 11.01 with D2006. We get an AV on Template.LoadfromStream with
latest version (4.92) of FASTMM MemoryManager.
When we use the default FASTMM MemoryManager which comes with D2006 we do
not get the AV.
Regards,
Filip Moons
procedure TForm1.Button1Click(Sender: TObject);
var
AReportStream1: TMemoryStream;
AReportStream2: TMemoryStream;
begin
AReportStream1 := TMemoryStream.Create;
try
rptDocument.Template.SaveToStream(AReportStream1);
try
AReportStream2 := TMemoryStream.Create;
try
rptDetail.Template.SaveToStream(AReportStream2);
try
rptDetail.Template.New;
ppDesigner.Form.ShowModal;
finally
rptDetail.Template.LoadfromStream(AReportStream2);
end;
finally
FreeAndNil(AReportStream2);
end;
finally
rptDocument.Template.LoadfromStream(AReportStream1); <<<<< AV occurs
in LoadfromStream
end;
finally
FreeAndNil(AReportStream1);
end;
end; {btnDrukOntwerpClick}
We use RB 11.01 with D2006. We get an AV on Template.LoadfromStream with
latest version (4.92) of FASTMM MemoryManager.
When we use the default FASTMM MemoryManager which comes with D2006 we do
not get the AV.
Regards,
Filip Moons
procedure TForm1.Button1Click(Sender: TObject);
var
AReportStream1: TMemoryStream;
AReportStream2: TMemoryStream;
begin
AReportStream1 := TMemoryStream.Create;
try
rptDocument.Template.SaveToStream(AReportStream1);
try
AReportStream2 := TMemoryStream.Create;
try
rptDetail.Template.SaveToStream(AReportStream2);
try
rptDetail.Template.New;
ppDesigner.Form.ShowModal;
finally
rptDetail.Template.LoadfromStream(AReportStream2);
end;
finally
FreeAndNil(AReportStream2);
end;
finally
rptDocument.Template.LoadfromStream(AReportStream1); <<<<< AV occurs
in LoadfromStream
end;
finally
FreeAndNil(AReportStream1);
end;
end; {btnDrukOntwerpClick}
This discussion has been closed.
Comments
Please upgrade to the latest version of RB 11 (11.04) and test with that.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
In my testing with FastMM 4.92 (just downloaded) and Delphi 2006, I am
unable to get the AV using the exact code you have below. What are the
FastMM options you have set? Anything else you can tell me about your test
app that might be different from the one I'm using on my machine?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Click the buttonto open the designer, close the designer and AV occurs
Ed Dressel
Team DM
Please do not post attachments to these newsgroups. This is against our
newsgroup policy. Send all examples in .zip format to
support@digital-metpahors.com.
Yes, I was able to recreate the issue. Just to be clear, this didn't occur
with earlier versions of FastMM? I am still researching the cause however
for a current workaround, you can call Template.New before trying to load
the second template.
...
finally
rptDocument.Template.New;
rptDocument.Template.LoadfromStream(AReportStream1);
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Sorry didn't know that.
This is a test project to make sure the exceptions we get in our main app
were not related to something else.
In our main app we get a 'Double free' message from FastMM in some
reportform with similar logic.
We are still researching this and will post our findings as soon as
possible.
Thanks for your patience.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
There is now a patch available for RB 11.04 that fixes this issue.
Registered RB 11.04 can email support@digital-metaphors.com and request the
patch.
I think the bug is an isolated case. The example provided contains a report
connected to a designer. The code calls LoadFromStream on a childreport, and
then calls LoadingFromStream on the main report. Commenting out either
LoadFromStream removes the AV.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com