Fix FlutterEngineOnVsync being called after engine shutdown #355
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.
Potentially fixes flutter-tizen/flutter-tizen#232.
This change is just a partial revert of #317. In the PR, I changed
tdm_client_from a plain pointer to ashared_ptrwhich is shared between the platform thread and the vblank thread, but it turned out that it results in a synchronization issue in flutter-tizen/flutter-tizen#232 for some unknown reason. The main reason I changed it into ashared_ptrwas that it seemed not safe to callOnEngineStopon a plain pointer because the object pointed by the pointer was being destroyed on thread exit. However, in reality,OnEngineStopis guaranteed to be called before akMessageQuitmessage is sent and thus no segmentation fault should occur.I also considered removing the vblank thread itself but thought it would not be very efficient since
tdm_client_handle_eventsis a blocking call and blocks the UI thread.