Skip to content

Commit

Permalink
Merge pull request #91 from Workiva/rap-2139-ensure-dispose-called-wh…
Browse files Browse the repository at this point in the history
…en-unload-fails

RAP-2139 Ensure dispose is called when onUnload fails.
  • Loading branch information
georgelesica-wf authored Jul 13, 2017
2 parents 0a5e183 + 2bee28f commit 0122dfc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/lifecycle_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,12 @@ abstract class LifecycleModule extends SimpleModule
rethrow;
} catch (error, stackTrace) {
_didUnloadController.addError(error, stackTrace);
await _postUnloadDisposable.dispose();
rethrow;
try {
await _disposableProxy.dispose();
} finally {
await _postUnloadDisposable.dispose();
rethrow;
}
}
}
}
Expand Down

0 comments on commit 0122dfc

Please sign in to comment.