I wonder why `scope(exit)` code is not executed when the program is terminated with Ctrl-C.

For example:

```
import std.stdio;
import core.thread;

void main()
{
    scope (exit)
    {
        writeln("Cleanup");
    }
    writeln("Waiting...");
    Thread.sleep(10.seconds);
    writeln("Done waiting...");
}
```

If I wait 10 seconds, I get "Cleanup" output.
But if I use Ctrl-C to terminate the program before 10 seconds elapse, there's no "Cleanup" output.

Is it intentional?
Is there any method to cleanup on Ctrl-C?

Reply via email to