-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 infinite polling for usb devices after the "add to whitelist" dia… #7486
Fix infinite polling for usb devices after the "add to whitelist" dia… #7486
Conversation
Addresses: https://bugs.dolphin-emu.org/issues/11126 @Zexaron |
Tested, works fine. |
Does that dialog really need to be allocated on the heap? It's a modal dialog box, so it blocks input to other windows until it's closed. Making it a stack variable would have the same effect as setting that attribute. @Zexaron @amaiorano |
…log has been opened once Problem is that USBDeviceAddToWhitelistDialog starts a timer once created to poll for devices every second. In Qt, closing a heap-allocated dialog doesn't delete it, so it keeps on polling. This fix is to allocate dialog on the stack, then use "exec" to run it modally without returning. Once closed, the stack instance will get destroyed, thus killing the timer.
9899091
to
3dec84a
Compare
(Edit: |
I was referring to it being a blocking call for the user, I forgot that show wasn't a blocking call for the application itself. |
I know you probably hadn't realized that show wasn't application blocking, but it's possible to make it so using exec, so that's what I did. Unless there's a good reason not to, should we go ahead with this version? Or go back to my first solution? |
I think using exec was the proper solution from the start, dunno why show was used instead. |
If we're happy with this, can someone from Dolphin team approve this PR? |
…log has been opened once
Problem is that USBDeviceAddToWhitelistDialog starts a timer once created to poll for devices every second. In Qt, closing a dialog doesn't delete it, so it keeps on polling. The fix is to tell QT to delete this dialog on close, so that the timer gets destroyed with it.