RTC Forums
November 24, 2024, 02:46:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Access violation when windows app shuts down  (Read 4572 times)
HelgeLange
RTC Expired
*
Posts: 100


« on: April 27, 2016, 06:28:49 PM »

Hi Danijel,

I have some not so rare and still strange access violations in some RTC Timer when the app shuts down.
At first I thought something with the disconnect (I have 2 RtcHHttpClient comps in a datamodule), I made sure to disconnect them when the app shuts down with DisconnectNow(True)

When running outside the IDE it causes the program to stay in memory.

I'm running out of ideas where to look for a solution.. any ideas ?

Thanks in advance,
Helge
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: April 28, 2016, 01:03:11 PM »

Access Violations happen when objects or memory are being access which have already been freed.

If the problem only happens when you are closing your Application, you have to make sure that all RTC threads are idle before destroying any objects or releasing any memory which is used by RTC components or in any way linked to the components. This means closing all RTC connections, making sure that your code which could result in an automatic reconnect attempt is disabled, any RTC Timers you may have created are stopped and there are no pending jobs in any TRtcQuickJob component.

For example ... before destroying a Form or a DataModule with events used by a TRtcHttpClient component, or any number of TRtcDataRequest, TRtcClientModule or TRtcResult components using a TRtcHttpClient component in Multi-Threaded mode, make sure there are no pending remote calls or data requests and the connection on the TRtcHttpClient component is closed.

Best Regards,
Danijel Tkalcec
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #2 on: April 28, 2016, 01:34:11 PM »

By the way ... if you haven't done that already, I recommend updating to the latest RTC SDK version (7.18) and checking if that makes any difference. There was a bug in the rtcHwndPool unit (fixed in v7.18 update), which could have resulted in an Access Violation if there was a connection active during shutdown.

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.