mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 15:18:10 +00:00
Summary: We have to uninstall UIManager synchronously to avoid a race condition when JS is capable to call already deallocated UIManager. Reviewed By: mdvacca Differential Revision: D10033406 fbshipit-source-id: 194d1ae2dd5ab09b036b1c165de289ada8e66014
39 lines
693 B
C++
39 lines
693 B
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "EventBeat.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
void EventBeat::request() const {
|
|
isRequested_ = true;
|
|
}
|
|
|
|
void EventBeat::beat() const {
|
|
if (!this->isRequested_) {
|
|
return;
|
|
}
|
|
|
|
isRequested_ = false;
|
|
|
|
if (beatCallback_) {
|
|
beatCallback_();
|
|
}
|
|
}
|
|
|
|
void EventBeat::induce() const {
|
|
// Default implementation does nothing.
|
|
}
|
|
|
|
void EventBeat::setBeatCallback(const BeatCallback &beatCallback) {
|
|
beatCallback_ = beatCallback;
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|