Skip to content

Commit 20e00fd

Browse files
authored
Fix coredump issue during exit app (#43)
1 parent bce2f14 commit 20e00fd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

flutter/shell/platform/tizen/flutter_tizen_engine.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ bool FlutterTizenEngine::RunEngine() {
216216
vsync_waiter_ = std::make_unique<TizenVsyncWaiter>(this);
217217
args.vsync_callback = [](void* user_data, intptr_t baton) -> void {
218218
auto* engine = static_cast<FlutterTizenEngine*>(user_data);
219-
engine->vsync_waiter_->AsyncWaitForVsync(baton);
219+
std::lock_guard<std::mutex> lock(engine->vsync_mutex_);
220+
if (engine->vsync_waiter_) {
221+
engine->vsync_waiter_->AsyncWaitForVsync(baton);
222+
}
220223
};
221224
}
222225
#endif
@@ -266,8 +269,11 @@ bool FlutterTizenEngine::StopEngine() {
266269
callback(registrar);
267270
}
268271
#ifndef WEARABLE_PROFILE
269-
if (vsync_waiter_) {
270-
vsync_waiter_.reset();
272+
{
273+
std::lock_guard<std::mutex> lock(vsync_mutex_);
274+
if (vsync_waiter_) {
275+
vsync_waiter_.reset();
276+
}
271277
}
272278
#endif
273279
FlutterEngineResult result = embedder_api_.Shutdown(engine_);

flutter/shell/platform/tizen/flutter_tizen_engine.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ class FlutterTizenEngine {
272272
std::unique_ptr<TizenRenderer> renderer_;
273273

274274
#ifndef WEARABLE_PROFILE
275+
std::mutex vsync_mutex_;
276+
275277
// The vsync waiter for the embedder.
276278
std::unique_ptr<TizenVsyncWaiter> vsync_waiter_;
277279
#endif

0 commit comments

Comments
 (0)