can we create main loop in ctor and delete in dtor?