X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a9d859df6f433c962a9ed777d2c26da6ce714441..4f260c9c68b42e6ccc82710efe6ca6e8418e721d:/src/gtk1/sockgtk.cpp?ds=sidebyside diff --git a/src/gtk1/sockgtk.cpp b/src/gtk1/sockgtk.cpp index ae2225a6a1..c8d449cfd8 100644 --- a/src/gtk1/sockgtk.cpp +++ b/src/gtk1/sockgtk.cpp @@ -28,10 +28,19 @@ void wxSocket_GDK_Input(gpointer data, gint WXUNUSED(source), GdkInputCondition condition) { - wxFDIOHandler * 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(wxFDIOHandler *handler, int fd, SocketDir d) + virtual int AddInput(wxSocketImplUnix *handler, int fd, SocketDir d) { return gdk_input_add (