<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:cgarcia@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <span class="fn">Carlos Garcia Campos</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] UIProcess crashes when using Japanese IM"
href="https://bugs.webkit.org/show_bug.cgi?id=163011">bug 163011</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #290822 Flags</td>
<td>commit-queue?
</td>
<td>commit-queue-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] UIProcess crashes when using Japanese IM"
href="https://bugs.webkit.org/show_bug.cgi?id=163011#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] UIProcess crashes when using Japanese IM"
href="https://bugs.webkit.org/show_bug.cgi?id=163011">bug 163011</a>
from <span class="vcard"><a class="email" href="mailto:cgarcia@igalia.com" title="Carlos Garcia Campos <cgarcia@igalia.com>"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=290822&action=diff" name="attach_290822" title="Proposed patch">attachment 290822</a> <a href="attachment.cgi?id=290822&action=edit" title="Proposed patch">[details]</a></span>
Proposed patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=290822&action=review">https://bugs.webkit.org/attachment.cgi?id=290822&action=review</a>
<span class="quote">> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:709
> + // We need to copy the event as otherwise it could be destroyed before we
> + // reach the lambda body.</span >
This could be a single line.
<span class="quote">> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:710
> + GdkEvent* event = gdk_event_copy(reinterpret_cast<GdkEvent*>(keyEvent));</span >
GUniquePtr<GdkEvent> event(gdk_event_copy(reinterpret_cast<GdkEvent*>(keyEvent)));
<span class="quote">> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:711
> + priv->inputMethodFilter.filterKeyEvent(&event->key, [priv, event](const WebCore::CompositionResults& compositionResults, InputMethodFilter::EventFakedForComposition faked) {</span >
[priv, event = WTFMove(event)]
With this, the lambda takes the ownership and you don't need to call gdk_event_free(). Maybe it's better to call this keyEvent and then you don't have to rename all other cases.
<span class="quote">> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:733
> + // We need to copy the event as otherwise it could be destroyed before we
> + // reach the lambda body.
> + GdkEvent* event = gdk_event_copy(reinterpret_cast<GdkEvent*>(keyEvent));
> + priv->inputMethodFilter.filterKeyEvent(&event->key, [priv, event](const WebCore::CompositionResults& compositionResults, InputMethodFilter::EventFakedForComposition faked) {</span >
Ditto.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>