RTC Forums
April 18, 2024, 07:05:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Access violation on Disconnect  (Read 3691 times)
ISIGest
RTC Expired
*
Posts: 121


« on: September 30, 2013, 09:04:25 PM »

How can I solve the access violation on 2515 row of "rtcConn.pas"?

    RtcFreeAndNil(FTimeout);
    RtcFreeAndNil(FTimeoutsOfAPI);
    RtcFreeAndNil(FInfo); <-- here I've the exception.



Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: September 30, 2013, 09:18:21 PM »

My wild guess is that you are using the components in Multi-Threaded mode and destroying them while they are still being used. To make sure the components are NOT in use before destroying them, you need to close all connections. To do this, you can use the "DisconnectNow" method on the TRtcHttpClient component and the "StopListenNow" method on the TRtcHttpServer component. This has to be done before ANY component used by the connection components is destroyed. Usually, this is done from the OnCloseQuery event when the components are placed on a Form, or the OnDestroy event when the components are placed on a DataModule.

If you are getting AVs in a running application simply because you've called "Disconnect", then I need an example Project which demonstrates this behavior, the Delphi IDE used to compile the Project, target platform the Project is being compiled for, and step by step instructions to reproduce the error,so I can debug it. Unfortunately, a line number inside a unit is not enough to find the source of the problem. This especially goes for Access Violations, which can be caused by a lot of things. Location of an Access Violation does not even have to be related to the actual source of the problem. Possible problems for AVs are memory overwriting, bad memory allocation and continued use of objects which have already been destroyed (calling Free but not setting the Object pointer to NIL).

Best Regards,
Danijel Tkalcec
Logged
ISIGest
RTC Expired
*
Posts: 121


« Reply #2 on: September 30, 2013, 09:41:59 PM »

Tomorrow I investigate....
This is an abnormal access violation I've used the demo to staart develop my application and I've found that this error is because the FInfo of connection is cleared on "UserInfo.SetNil(LClient);" in "doLogOut(uname:String;sessid:RtcString);" method....
see you tomorrow.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: September 30, 2013, 10:07:39 PM »

Ok. Let me know if you find out what is causing the AV. If it looks like the problem is somewhere in the RTC SDK, please create a simple Project to reproduce the bug and send it to me by E-Mail (source code), along with instructions to reproduce it. Without that, or some other clear instructions on reproducing the issue, I can only make wild guesses.

Please, also make sure to include more information about the compiler (Delphi version) and target platform (Win32, Win64, MacOSX, iOS Simulator, iOS Device, Android Simulator, Android Device).

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.