<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <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&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=290822&amp;action=diff" name="attach_290822" title="Proposed patch">attachment 290822</a> <a href="attachment.cgi?id=290822&amp;action=edit" title="Proposed patch">[details]</a></span>
Proposed patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=290822&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=290822&amp;action=review</a>

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:709
&gt; +    // We need to copy the event as otherwise it could be destroyed before we
&gt; +    // reach the lambda body.</span >

This could be a single line.

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:710
&gt; +    GdkEvent* event = gdk_event_copy(reinterpret_cast&lt;GdkEvent*&gt;(keyEvent));</span >

GUniquePtr&lt;GdkEvent&gt; event(gdk_event_copy(reinterpret_cast&lt;GdkEvent*&gt;(keyEvent)));

<span class="quote">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:711
&gt; +    priv-&gt;inputMethodFilter.filterKeyEvent(&amp;event-&gt;key, [priv, event](const WebCore::CompositionResults&amp; 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">&gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:733
&gt; +    // We need to copy the event as otherwise it could be destroyed before we
&gt; +    // reach the lambda body.
&gt; +    GdkEvent* event = gdk_event_copy(reinterpret_cast&lt;GdkEvent*&gt;(keyEvent));
&gt; +    priv-&gt;inputMethodFilter.filterKeyEvent(&amp;event-&gt;key, [priv, event](const WebCore::CompositionResults&amp; 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>