[ios] Remove stale image if snapshotting failed

This CL works towards reducing duplicate code in snapshot_generator.mm.
An improvement made in an earlier CL was only made to web view snapshots
and not to native views. This CL fixes native view snapshots.

Bug: 918032
Change-Id: I37d0a9bdead31ccce8e467846c2927105c0a76c7
Reviewed-on: https://chromium-review.googlesource.com/c/1395878
Reviewed-by: edchin <edchin@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619972}
1 file changed