Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

AV on Template.LoadfromStream with latest version (4.92) of FASTMM MemoryManager

edited May 2009 in General
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}

Comments

  • edited May 2009
    Hi Filip,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009
    The AV remains in 11.04

  • edited May 2009
    Hi Filip,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009
    Full project + FastMM4Options.inc attached

    Click the buttonto open the designer, close the designer and AV occurs
  • edited May 2009
    I use 11.04 and Fast MM an dthere are no prolems.

    Ed Dressel
    Team DM

  • edited May 2009
    Nico, do you get the AV now with the attached project?

  • edited May 2009
    Filip,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009
    > Please do not post attachments to these newsgroups. This is against our

    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.
  • edited May 2009
    Any news on a fix concerning the AV with the latest version off FastMM?

  • edited May 2009
    Hi Filip,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009

    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
This discussion has been closed.