mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-12-03 12:30:46 +00:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
This commit is contained in:
parent
451f77ff1e
commit
c626704cb2
@ -35,12 +35,10 @@ std::shared_ptr<PanelListenerImpl> PanelListenerImpl::GetInstance()
|
||||
|
||||
PanelListenerImpl::~PanelListenerImpl()
|
||||
{
|
||||
env_ = nullptr;
|
||||
}
|
||||
|
||||
void PanelListenerImpl::SaveInfo(napi_env env, const std::string &type, napi_value callback, uint32_t windowId)
|
||||
{
|
||||
env_ = env;
|
||||
std::shared_ptr<JSCallbackObject> cbObject =
|
||||
std::make_shared<JSCallbackObject>(env, callback, std::this_thread::get_id());
|
||||
auto result = callbacks_.Find(windowId);
|
||||
@ -93,7 +91,7 @@ void PanelListenerImpl::OnPanelStatus(uint32_t windowId, bool isShow)
|
||||
}
|
||||
work->data = new (std::nothrow) UvEntry(callback.second);
|
||||
uv_loop_s *loop = nullptr;
|
||||
napi_get_uv_event_loop(env_, &loop);
|
||||
napi_get_uv_event_loop(callback.second.env_, &loop);
|
||||
uv_queue_work_with_qos(
|
||||
loop, work, [](uv_work_t *work) {},
|
||||
[](uv_work_t *work, int status) {
|
||||
|
@ -40,7 +40,6 @@ public:
|
||||
std::shared_ptr<JSCallbackObject> cbCopy;
|
||||
explicit UvEntry(const std::shared_ptr<JSCallbackObject> &cb) : cbCopy(cb) {}
|
||||
};
|
||||
napi_env env_ = nullptr;
|
||||
ConcurrentMap<uint32_t, ConcurrentMap<std::string, std::shared_ptr<JSCallbackObject>>> callbacks_;
|
||||
static std::mutex listenerMutex_;
|
||||
static std::shared_ptr<PanelListenerImpl> instance_;
|
||||
|
Loading…
Reference in New Issue
Block a user