Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): static destruct crash in main thread for ios #4085

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dom/src/dom/taitank_layout_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class TaitankLayoutConsts {
{"inherit", DIRECTION_INHERIT}, {"ltr", DIRECTION_LTR}, {"rtl", DIRECTION_RTL}};
};

static std::shared_ptr<TaitankLayoutConsts> global_layout_consts = nullptr;
static TaitankLayoutConsts* global_layout_consts = nullptr;

#define TAITANK_GET_STYLE_DECL(NAME, TYPE, DEFAULT) \
static TYPE GetStyle##NAME(const std::string& key) { \
Expand Down Expand Up @@ -823,7 +823,7 @@ void TaitankLayoutNode::Deallocate() {

void InitLayoutConsts() {
if (global_layout_consts == nullptr) {
global_layout_consts = std::make_shared<TaitankLayoutConsts>();
global_layout_consts = new TaitankLayoutConsts();
}
}

Expand Down
4 changes: 2 additions & 2 deletions driver/js/src/napi/jsc/jsc_ctx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ constexpr char16_t kSetStr[] = u"set";

static std::once_flag global_class_flag;
static JSClassRef global_class;
static std::shared_ptr<ConstructorDataManager> global_constructor_data_mgr = nullptr;
static ConstructorDataManager* global_constructor_data_mgr = nullptr;

JSCCtx::JSCCtx(JSContextGroupRef group, std::weak_ptr<VM> vm): vm_(vm) {
std::call_once(global_class_flag, []() {
JSClassDefinition global = kJSClassDefinitionEmpty;
global_class = JSClassCreate(&global);
global_constructor_data_mgr = std::make_shared<ConstructorDataManager>();
global_constructor_data_mgr = new ConstructorDataManager();
});

context_ = JSGlobalContextCreateInGroup(group, global_class);
Expand Down
Loading