Vala doesn't unref file scope variables
Submitted by Sam
Link to original bug (#617012)
When a program creates a file scope variable, it is never unref'ed so its destructors are never run, which might lead to unclosed resources or abruptly terminated communications.
Basically its hard to make global singletons.
public class TestClass
{
~TestClass()
{
stdout.printf("Destroyed\n");
}
}
TestClass tc;
public static void main()
{
tc = new TestClass();
}