c3c icon indicating copy to clipboard operation
c3c copied to clipboard

@finalizer doesn't been called

Open LukyGuyLucky opened this issue 1 year ago • 2 comments

Tried the handbook @finalizer with below code snippets but found that @finalizer statement doen't been called under win10 64 bit:

module init_fin;

import std::io;

fn void run_at_startup() @init
{
	io::printn("Initializer... called!");
}

fn void run_at_shutdown() @finalizer
{
	io::printn("Finalizer... called!");
}

fn int main(String[])
{
	io::printn("Hello world!");
	
	return 0;
}

Output:

Initializer... called!
Hello world!

LukyGuyLucky avatar Aug 16 '24 01:08 LukyGuyLucky

Yes, this is a known problem which is currently investigated.

lerno avatar Aug 16 '24 21:08 lerno

Thank you for filing the issue, because I think we forgot to do that. Unfortunately the solution isn't simple.

lerno avatar Aug 16 '24 21:08 lerno

This should now work, please check.

lerno avatar Sep 15 '24 20:09 lerno

This should now work, please check.

Yes,it works.Thanks for letting me know.

LukyGuyLucky avatar Sep 16 '24 01:09 LukyGuyLucky