SocketApi: Fix crash with readyRead() after disconnected() #7044
authorChristian Kamm <mail@ckamm.de>
Mon, 18 Feb 2019 09:53:41 +0000 (10:53 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:42 +0000 (10:58 +0100)
commit2e11f14a6bfac32c25e305f65ac68a659cf01abb
treed4d4dac69788e645a1f8a2875b5d04a53dcff6d1
parent6199e140a58bd7db9d65fdf559b29aea0be84254
SocketApi: Fix crash with readyRead() after disconnected() #7044

With the recent bugfix to avoid sending messages on dead connections
0bfe7ac250c54f5415c0a794c7b271428e83c3cf
the client now crashed if readyRead() was received after disconnected()
for the socket as the listener for that connection was already removed.

This code fixes it by still invoking the handler from readyRead() but
passing a SocketListener that won't attempt to send messages.
src/gui/socketapi.cpp