Adding support for non-local return on closures
Adding references to qwidget/qmainwindow to prevent GC