Arno Garrels wrote: > Olivier Sannier wrote: > >> Arno Garrels wrote: >> >>> Olivier Sannier wrote: >>> >>> >>> >>>> Assert(Assigned(GWndHandlerPool), 'GWndHandlerPool is already nil, >>>> check your threads!!!'); >>>> >>>> >>> I just wonder whether we shouldn't check "not GUnitFinalized" rather >>> than "Assigned(GWndHandlerPool)", what do you think? >>> >> No we should not as it would go against the whole concept of the >> proposed patch. >> The basic idea is that it is quite easy to get the situation where the >> unit is finalized but sockets are still connected and working. >> So the >> patch allows to continue working in this situation without any crash, >> letting either the finalization section or the last socket (whichever >> comes last) to destroy the global handle pool. >> > > Assert(not GUnitFinalized..) would not change this goal, it just would > throw an error (earlier) in cases when a thread tries to create new > sockets even though finalization has been passed and GWndHandlerPool > is not yet nil. I do not understand why you want a thread being able to > create new sockets in this situation? Well, you are quite right, I just felt it would be "cleaner" to assert on the very element that would trigger an access violation two lines below. I thought it would be clearer for users why we test on GWndHandlerPool rather than testing on GUnitFinalized.
Cheers Olivier -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be