If you are getting exceptions or memory leaks on your application shutdown, or if your client or server are not immediately shutting down when you try to close them, you are most likely not closing your RTC connections properly before closing your application.
Here is a short article from the old RTC SDK FAQ which describes what you should do to have a RTC Client and/or Server application perform a clean shut down (usually done from Main form's "OnCloseQuery" event).
Best Regards,
Danijel Tkalcec