Page 1 of 1

AV when releasing TScHttpWebRequest

Posted: Thu 17 Jun 2021 16:37
by Samuel
When I run Free on TScHttpWebRequest I get an AV.

Below is the routine I'm using:

Code: Select all

Function Download_File(Const wURL_Address, wLocal_Filename: String; var wError_Message: String): Boolean;
var
   wScHttpWebRequest: TScHttpWebRequest;
   wFileStream: TFileStream;
   wScHttpWebResponse: TScHttpWebResponse;
begin
   Result:=False;
   wError_Message:='';
   if FileExists(wLocal_Filename) then Begin
      If Not DeleteFile(wLocal_FileName) Then Begin
         wError_Message:='Could not delete the file';
         Exit;
      End;   
   End;
   wScHttpWebRequest:=TScHttpWebRequest.Create(wURL_Address);
   Try
      wScHttpWebResponse:=TScHttpWebResponse.Create;
      Try
         wFileStream:=TFileStream.Create(wLocal_Filename, fmCreate);
         Try
            Try
               wScHttpWebRequest.IPVersion:=ivIPBoth;
               wScHttpWebRequest.SSLOptions.IgnoreServerCertificateValidity:=False;
               wScHttpWebRequest.Proxy.Address := zprPROXY;
               wScHttpWebRequest.Proxy.Port    := StrToIntDef(zprPORTA, 8080);
               wScHttpWebRequest.Proxy.Credentials.UserName := zprUSER_PROXY;
               wScHttpWebRequest.Proxy.Credentials.Password := zprPWD_PROXY;
               wScHttpWebResponse:=wScHttpWebRequest.GetResponse;
               wScHttpWebResponse.ReadToStream(wFileStream);
               Result:=True;
            Except
               On E: SysUtils.Exception do
                  wError_Message := E.Message;
            End;
         Finally
            wFileStream.Free;
         End;
      Finally
         wScHttpWebResponse.Free;
      End;
   Finally
      wScHttpWebRequest.Free; //<---AV on this line
   End;
end;
Can anyone identify what is wrong?

I'm using SecureBridge 9.5.1 with Delphi 10.4.2.

Thank you

Re: AV when releasing TScHttpWebRequest

Posted: Fri 18 Jun 2021 15:39
by Dimon
Hi Samuel,

We've checked your code and unfortunately, we could not reproduce the issue. We really want to help with solving your problem, however we need to generate the same conditions. In order to reproduce it we need a completed sample with real URL.
Please create and send it to our team using the contact form below:
https://www.devart.com/company/contactform.html

Re: AV when releasing TScHttpWebRequest

Posted: Fri 18 Jun 2021 18:07
by Samuel
Hi Dimon,

When preparing a sample program to send to you I found that the error only occurs if I use FastMM5.

Do I need to make any special settings to use SecureBridge with FastMM5?

Re: AV when releasing TScHttpWebRequest

Posted: Tue 22 Jun 2021 13:24
by YanishevskiyVI
Hi Samuel,

We have reproduced the issue and fixed it. This fix will be included in the next SecureBridge build.

Best regards,
Vitaliy

Re: AV when releasing TScHttpWebRequest

Posted: Tue 21 Sep 2021 12:30
by YanishevskiyVI
Hi Samuel!

We are pleased to announce that our SecureBridge 10.0 new version is now available! (with RAD 11 support!)
Feel free to download the new update right from the Customer Portal to try it!
Please, let us know if you have any questions!

Regards,
Vitaliy