Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #291
Builds on top of PR #290
2 things were happening:
if an exception occurred in saving an Image-based Story frame and this made removing their AddedViews from the ghost (offscreen) photoEditorView impossible (as it would derail execution to the Exception handler), then those AddedViews would be left depending on that ghost view, and once we want to add them back it would be impossible, producing the crash. For this, we added a
finally
block to the exception handler to make sure to release those AddedViews, in 601463b.when the service finishes working, the EventBus listener in the ComposeLoopFrameActivity would try and re-select the current frame, re-adding the AddedViews to the real (visible) photoEditorView and as such, leaving them impossible to be re-added to a new instance of photoEdiitorView later (as it would be the case when you need to manage errors, opening a new instance of the Activity from an error notification or snackbar). This frame selection refresh behavior we have in that listener was an old behavior we wanted to have before we decided to force exiting the Activity once the Service has been triggered (as per our use case) so, removed that code altogether in 6d5df8c
To test:
throw Exception("this is a test")
right before this line, this way the error handling mechanism takes course.