SRF: avoid leaking resources if not run to completion

SRF: avoid leaking resources if not run to completion

Edit