mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-12-18 04:10:21 +00:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
This commit is contained in:
parent
f33853cba3
commit
5259bb1a91
@ -99,6 +99,7 @@ private:
|
||||
|
||||
void Initialize();
|
||||
void WorkThread();
|
||||
void QuitWorkThread();
|
||||
|
||||
void OnInitialInput(Message *msg);
|
||||
void OnStartInput(Message *msg);
|
||||
|
@ -46,12 +46,12 @@ InputMethodAbility::InputMethodAbility() : stop_(false)
|
||||
InputMethodAbility::~InputMethodAbility()
|
||||
{
|
||||
IMSA_HILOGI("InputMethodAbility::~InputMethodAbility");
|
||||
instance_ = nullptr;
|
||||
QuitWorkThread();
|
||||
if (msgHandler) {
|
||||
delete msgHandler;
|
||||
msgHandler = nullptr;
|
||||
}
|
||||
stop_ = true;
|
||||
instance_ = nullptr;
|
||||
}
|
||||
|
||||
sptr<InputMethodAbility> InputMethodAbility::GetInstance()
|
||||
@ -196,6 +196,7 @@ void InputMethodAbility::WorkThread()
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
IMSA_HILOGD("the message is %{public}d.", msg->msgId_);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -574,5 +575,15 @@ void InputMethodAbility::BindServiceAndClient()
|
||||
sptr<IInputMethodAgent> inputMethodAgent = sptr(new InputMethodAgentProxy(inputMethodAgentStub));
|
||||
mImms->SetCoreAndAgent(stub, inputMethodAgent);
|
||||
}
|
||||
|
||||
void InputMethodAbility::QuitWorkThread()
|
||||
{
|
||||
stop_ = true;
|
||||
Message *msg = new Message(MessageID::MSG_ID_QUIT_WORKER_THREAD, nullptr);
|
||||
msgHandler->SendMessage(msg);
|
||||
if (workThreadHandler.joinable()) {
|
||||
workThreadHandler.join();
|
||||
}
|
||||
}
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
|
Loading…
Reference in New Issue
Block a user