Valentin Shergin 84fbad6215 Fabric: Safer UIManager deallocation and uninstallation
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
2018-09-26 10:18:39 -07:00

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