When is the unit finalization method used?

I have an application that recently crashed and I was able to get its callstack using EurekaLog. What I noticed was that the finalization of the unit was completed, but the application did not close and continued to work.

AFAIK, termination sections are called only when the application terminates. But that was not the case with me.

Does anyone know why the finalization method was called when it was not done?

EDIT

This application does not use DLL or bpls.

EDIT2

Is it possible for a thread to terminate upon completion?

+6
source share
1 answer

Finalization is called in two places. The most common is when the application terminates. But they can also be called when the DLL (or BPL) is unloaded, which happens automatically when the application terminates, but it can also happen in the middle of a running program if the code explicitly unloads it.

Is this possible?

+5
source

Source: https://habr.com/ru/post/914923/


All Articles