mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Assert on destruction non-empty of ShadowTreeRegistry
Summary: Destruction of Scheduler (and ShadowTreeRegistry as part of it) which has some running Surfaces is not a good thing and practically a bug on the application layer. With this assert we throw early to flag the issue. Changelog: [Internal] - Dev only assert indicating a broken invariant in ShadowTreeRegistry Reviewed By: sammy-SC Differential Revision: D17924491 fbshipit-source-id: 6b7433fe47630e993e7d5b969f3113f96124b6c9
This commit is contained in:
committed by
Facebook Github Bot
parent
e7ef9921d3
commit
8bce9c59bb
@@ -8,6 +8,10 @@
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
ShadowTreeRegistry::~ShadowTreeRegistry() {
|
||||
assert(registry_.size() == 0 && "Deallocation of non-empty `ShadowTreeRegistry`.");
|
||||
}
|
||||
|
||||
void ShadowTreeRegistry::add(std::unique_ptr<ShadowTree> &&shadowTree) const {
|
||||
std::unique_lock<better::shared_mutex> lock(mutex_);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace react {
|
||||
class ShadowTreeRegistry final {
|
||||
public:
|
||||
ShadowTreeRegistry() = default;
|
||||
~ShadowTreeRegistry();
|
||||
|
||||
/*
|
||||
* Adds a `ShadowTree` instance to the registry.
|
||||
|
||||
Reference in New Issue
Block a user