File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
flutter/shell/platform/tizen Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff 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_);
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments