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 crash when pressing Tab #92
Conversation
| @@ -676,13 +676,16 @@ bool CFrame::RendererHasFocus() | |||
| if (m_RenderParent->GetParent()->GetHWND() == GetForegroundWindow()) | |||
| return true; | |||
| #else | |||
| if (wxWindow::FindFocus() == NULL) | |||
| wxWindow *window = wxWindow::FindFocus(); | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
http://trac.wxwidgets.org/ticket/15409 These wx bugs are pretty old. It may be a bread crumb trail, but it is worth reading. At least it is a known issue. |
|
I still think this PR is a good way to fix it. If wx documents its API with "might return NULL" we should make sure to handle NULL correctly whether it is a bug in wx or not. |
|
LGTM just needs a rebase. FindFocus is a static function, it returns a pointer. Adding code to handle it returning NULL should not be an issue. Why it returns NULL? Because the focus was lost. Call it a workaround for a known issue if you'd like, we don't need to spend time fixing wx. Especially considering we want to move to QT, right.. right?! :( |
When pressing Tab for a long time, Dolphin will sooner or later crash because the result of FindFocus() has become NULL (toctou).
When pressing Tab for a long time, Dolphin will sooner or later crash because the result of FindFocus() has become NULL (toctou). No idea why that happens. Obviously, we are passing key events to WX even after handling them ourselves. I don't think we should do that. In any case, this fix makes the code cleaner.