Skip to content

Commit

Permalink
Fix coredump issue during exit app (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaowei-guan authored Aug 24, 2023
1 parent bce2f14 commit 20e00fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions flutter/shell/platform/tizen/flutter_tizen_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ bool FlutterTizenEngine::RunEngine() {
vsync_waiter_ = std::make_unique<TizenVsyncWaiter>(this);
args.vsync_callback = [](void* user_data, intptr_t baton) -> void {
auto* engine = static_cast<FlutterTizenEngine*>(user_data);
engine->vsync_waiter_->AsyncWaitForVsync(baton);
std::lock_guard<std::mutex> lock(engine->vsync_mutex_);
if (engine->vsync_waiter_) {
engine->vsync_waiter_->AsyncWaitForVsync(baton);
}
};
}
#endif
Expand Down Expand Up @@ -266,8 +269,11 @@ bool FlutterTizenEngine::StopEngine() {
callback(registrar);
}
#ifndef WEARABLE_PROFILE
if (vsync_waiter_) {
vsync_waiter_.reset();
{
std::lock_guard<std::mutex> lock(vsync_mutex_);
if (vsync_waiter_) {
vsync_waiter_.reset();
}
}
#endif
FlutterEngineResult result = embedder_api_.Shutdown(engine_);
Expand Down
2 changes: 2 additions & 0 deletions flutter/shell/platform/tizen/flutter_tizen_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ class FlutterTizenEngine {
std::unique_ptr<TizenRenderer> renderer_;

#ifndef WEARABLE_PROFILE
std::mutex vsync_mutex_;

// The vsync waiter for the embedder.
std::unique_ptr<TizenVsyncWaiter> vsync_waiter_;
#endif
Expand Down

0 comments on commit 20e00fd

Please sign in to comment.