In GSocket_Destroy reorder GUI_Destroy and Shutdown when compiling for Darwin.
This is necessary to comply with the Apple documentation for CFSocket which
states quite explcitly that the CFSocket must be invalidated prior to close.
Likewise in GSocket_Read don't enable input events until we have finished
reading the data. This is necessary because an input event will be
immediately generated but all the data will have been read by the current
callback which leads to the GSocket code thinking the connection has been
lost and when wxYield recursion is involved will lead to crashes or an assert.
Because we are doing a compile time test only for Darwin this will also
affect wxGTK running on Darwin. It appears possible for the new order to work
on all platforms but more testing would be required.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24997
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775