1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-22 00:15:48 +02:00

Fix not disposing frame object when handling key events

This commit is contained in:
chylex 2022-01-08 05:44:24 +01:00
parent 03f3d4d450
commit 68582f6973
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548

View File

@ -14,8 +14,12 @@ protected virtual bool HandleRawKey(IWebBrowser browserControl, Keys key, CefEve
}
bool IKeyboardHandler.OnPreKeyEvent(IWebBrowser browserControl, IBrowser browser, KeyType type, int windowsKeyCode, int nativeKeyCode, CefEventFlags modifiers, bool isSystemKey, ref bool isKeyboardShortcut) {
if (type == KeyType.RawKeyDown && !browser.FocusedFrame.Url.StartsWith("devtools://")) {
return HandleRawKey(browserControl, (Keys) windowsKeyCode, modifiers);
if (type == KeyType.RawKeyDown) {
using var frame = browser.FocusedFrame;
if (!frame.Url.StartsWith("devtools://")) {
return HandleRawKey(browserControl, (Keys) windowsKeyCode, modifiers);
}
}
return false;