So, after some recent changes we discovered that one of our oldest applications is sometimes crashing on shutdown. This manifests itself either in the form of \"Runtime error 21
Well the Runtime error 216 are memory issue (Access violation), it seems like you refer to some Object which doesnt exist at that point of time.
Emarcadero writes:
Applications that use the SysUtils class map most runtime errors to Exceptions, which allow your application to resolve the error without terminating
Did you try to set a breackpoint at the finalization section of Sysutils?
I would try it with an Allocation / Memory Profiler, its not sure you will find the error code line but this may show you some parts of your code where Memory issues occure.