I say.

A blog by Joakim Beijar, I solve interesting and mundane problems at Mios Ltd and hack at night on github.com/kaa.

Handling Control-C with finalizers in the CLR

24 Jun 2008

Yesterday was spent debugging an online-banking payment verification service for one our our customers. After a while I found that my test data was running out even though it was supposed to start from the beginning with every round I ran the code. As it turns out the problem was that locks were not beeing freed even though they were supposed to be guaranteed by try { } ... finally { } blocks.

Anyway, so now I find out that finalizers are not called when exiting due to Control-C, and a number of other reasons too. Fortunately there is a solution provided in the previous link, Jolly!