X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/37465b7281eb2a5202b765f1b67b4ec6126f816c..52147d1c4bb54b904253e388da76747e459157c0:/src/gtk/sockgtk.cpp diff --git a/src/gtk/sockgtk.cpp b/src/gtk/sockgtk.cpp index 876891cfb0..c8d449cfd8 100644 --- a/src/gtk/sockgtk.cpp +++ b/src/gtk/sockgtk.cpp @@ -28,10 +28,19 @@ void wxSocket_GDK_Input(gpointer data, gint WXUNUSED(source), GdkInputCondition condition) { - wxSocketImpl * const handler = static_cast(data); + wxSocketImplUnix * const handler = static_cast(data); if ( condition & GDK_INPUT_READ ) + { handler->OnReadWaiting(); + + // we could have lost connection while reading in which case we + // shouldn't call OnWriteWaiting() as the socket is now closed and it + // would assert + if ( handler->m_fd == INVALID_SOCKET ) + return; + } + if ( condition & GDK_INPUT_WRITE ) handler->OnWriteWaiting(); } @@ -40,7 +49,7 @@ void wxSocket_GDK_Input(gpointer data, class GTKSocketManager : public wxSocketInputBasedManager { public: - virtual int AddInput(wxSocketImpl *handler, int fd, SocketDir d) + virtual int AddInput(wxSocketImplUnix *handler, int fd, SocketDir d) { return gdk_input_add (