static int Main() { #if DEBUG Helpers.LoadDebugVariables(); #endif Task.Factory.StartNew(() => { while (true) { Thread.Sleep(10); GC.Collect(GC.MaxGeneration); } // ReSharper disable FunctionNeverReturns }); // ReSharper restore FunctionNeverReturns using (var r = new StringVector(0)) { using (var app = new QGuiApplication(r)) { using (var engine = new QQmlApplicationEngine()) { QQmlApplicationEngine.RegisterType <TestQmlImport>("test", 1, 1); engine.loadFile("main.qml"); return(app.exec()); } } } }