Making the snapshot thread a member of the mainwindow class to extend its lifespan