unref mainloop