qt: use deleteLater to remove send entries

Use deleteLater() instead of delete, as it is not allowed
to delete widgets directly in an event handler.
Should solve the MacOSX random crashes on send with coincontrol.

Rebased-From: 6c98cca9e4
This commit is contained in:
Wladimir J. van der Laan
2013-12-04 08:17:57 +01:00
parent a0a5b20156
commit 8c3ba8be01

View File

@@ -170,7 +170,7 @@ void SendCoinsDialog::clear()
// Remove entries until only one left
while(ui->entries->count())
{
delete ui->entries->takeAt(0)->widget();
ui->entries->takeAt(0)->widget()->deleteLater();
}
addEntry();
@@ -226,7 +226,7 @@ void SendCoinsDialog::updateRemoveEnabled()
void SendCoinsDialog::removeEntry(SendCoinsEntry* entry)
{
delete entry;
entry->deleteLater();
updateRemoveEnabled();
}