feature #3782: Remove snapshot list if empty

This commit is contained in:
Ruben S. Montero committed 2015-06-09 00:21:29 +02:00
1 parent bdb1e591da
commit c3741e4fa1
1 file changed
+9
+9
View File
@@ -4434,5 +4434,14 @@ void VirtualMachine::delete_disk_snapshot(int did, int snap_id)
}
it->second->delete_snapshot(snap_id);
if (it->second->size() == 0)
{
Snapshots * tmp = it->second;
snapshots.erase(it);
delete tmp;
}
}