Compile cleanup list before the domain is actually undefined (TUI-108)