Closed swift-kim closed 2 years ago
I changed tdm_client_
back to a share_ptr
and just replaced reset()
with OnEngineStop()
according to @bbrto21's suggestion. The problem was that the instance was not destroyed when reset()
was called and thus engine_ = nullptr;
was not called as I expected. Thank you!
Potentially fixes https://github.com/flutter-tizen/flutter-tizen/issues/232.
This change is just a partial revert of https://github.com/flutter-tizen/engine/pull/317. In the PR, I changed
tdm_client_
from a plain pointer to ashared_ptr
which is shared between the platform thread and the vblank thread, but it turned out that it results in a synchronization issue in https://github.com/flutter-tizen/flutter-tizen/issues/232 for some unknown reason. The main reason I changed it into ashared_ptr
was that it seemed not safe to callOnEngineStop
on a plain pointer because the object pointed by the pointer was being destroyed on thread exit. However, in reality,OnEngineStop
is guaranteed to be called before akMessageQuit
message 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_events
is a blocking call and blocks the UI thread.