virtualkeyboard: fixed restart crash
This commit is contained in:
committed by
François Revol
parent
5e0fb24359
commit
b8fe0b588d
@@ -1143,7 +1143,7 @@ void
|
||||
KeyboardLayoutView::_SendKeyDown(const Key* key)
|
||||
{
|
||||
KID_CALLED();
|
||||
|
||||
|
||||
BMessage* message = new BMessage(B_KEY_DOWN);
|
||||
message->AddInt64("when", system_time());
|
||||
message->AddData("states", B_UINT8_TYPE, &fKeyState,
|
||||
@@ -1171,4 +1171,5 @@ KeyboardLayoutView::_SendKeyDown(const Key* key)
|
||||
|
||||
if (fDevice->EnqueueMessage(message) != B_OK)
|
||||
delete message;
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ instantiate_input_device()
|
||||
|
||||
VirtualKeyboardInputDevice::VirtualKeyboardInputDevice()
|
||||
{
|
||||
fKeyboardWindow = new VirtualKeyboardWindow(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +38,7 @@ VirtualKeyboardInputDevice::InitCheck()
|
||||
status_t
|
||||
VirtualKeyboardInputDevice::Start(const char* name, void* cookie)
|
||||
{
|
||||
fKeyboardWindow = new VirtualKeyboardWindow(this);
|
||||
fKeyboardWindow->Show();
|
||||
return B_OK;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ VirtualKeyboardInputDevice::Start(const char* name, void* cookie)
|
||||
status_t
|
||||
VirtualKeyboardInputDevice::Stop(const char* name, void* cookie)
|
||||
{
|
||||
if (fKeyboardWindow) {
|
||||
if (fKeyboardWindow->Lock()) {
|
||||
fKeyboardWindow->Quit();
|
||||
fKeyboardWindow = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user