Add a refcount to RemoteManager so it only closes when unused

* We previously were only checking if all lookups had completed before
  self-deleting, but we also need to make sure nothing externally is
  still holding onto the dialog.
This commit is contained in:
baldurk
2017-04-19 18:29:10 +01:00
parent 7193b40241
commit 2eb4a35680
3 changed files with 26 additions and 8 deletions
+5 -2
View File
@@ -1431,8 +1431,11 @@ void MainWindow::on_action_Attach_to_Running_Instance_triggered()
void MainWindow::on_action_Manage_Remote_Servers_triggered()
{
// the manager deletes itself when all lookups terminate
RDDialog::show(new RemoteManager(m_Ctx, this));
RemoteManager *rm = new RemoteManager(m_Ctx, this);
RDDialog::show(rm);
// now that we're done with it, the manager deletes itself when all lookups terminate (or
// immediately if there are no lookups ongoing).
rm->closeWhenFinished();
}
void MainWindow::on_action_Start_Android_Remote_Server_triggered()