• Yuwei Huang's avatar
    [CRD iOS] Fix a race condition bug of input_stub · 00475fa5
    Yuwei Huang authored
    When a connection is closed by the host, ChromotingClient will first
    get the notification on network thread, then free the connection object
    and notify UI components on the UI thread. In some rare situations,
    a mouse event may be posted to the network thread after the connection
    is reset and before ChromotingSession starts cleaning up resources, and
    causes segfault because the input_stub is already freed by the
    connection.
    
    This CL fixes this problem by immediately resetting the input_stub when
    the connection is being reset.
    
    Bug: 766698
    Change-Id: I95d230565154dfe3762b9de516f5fa02dabb2bba
    Reviewed-on: https://chromium-review.googlesource.com/683801Reviewed-by: default avatarScott Nichols <nicholss@chromium.org>
    Commit-Queue: Yuwei Huang <yuweih@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#504443}
    00475fa5
chromoting_client.cc 9.74 KB