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() {
216
216
vsync_waiter_ = std::make_unique<TizenVsyncWaiter>(this );
217
217
args.vsync_callback = [](void * user_data, intptr_t baton) -> void {
218
218
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
+ }
220
223
};
221
224
}
222
225
#endif
@@ -266,8 +269,11 @@ bool FlutterTizenEngine::StopEngine() {
266
269
callback (registrar);
267
270
}
268
271
#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
+ }
271
277
}
272
278
#endif
273
279
FlutterEngineResult result = embedder_api_.Shutdown (engine_);
Original file line number Diff line number Diff line change @@ -272,6 +272,8 @@ class FlutterTizenEngine {
272
272
std::unique_ptr<TizenRenderer> renderer_;
273
273
274
274
#ifndef WEARABLE_PROFILE
275
+ std::mutex vsync_mutex_;
276
+
275
277
// The vsync waiter for the embedder.
276
278
std::unique_ptr<TizenVsyncWaiter> vsync_waiter_;
277
279
#endif
You can’t perform that action at this time.
0 commit comments