Francois PIETTE wrote: >>> About your changes: It's sure that using FreeAndNil is a good idea. >>> Checking >>> Assigned(GWndHandlerPool) is also good but be aware that this would hide >>> the >>> exception and still may produce unexpected results since the lock is no >>> more >>> used. If you some reason a thread is still working and using the same >>> code >>> section, you'll be in trouble. Granted this is not common situation. >>> >>> >> Well, it would be quite unlikely because it occurs in finalization >> sections. Yes, there could still be threads at that moment of the >> application, but I don't think it would be much stable to have them >> running anyway. >> > > I wonder if it would not be better to have an exception raised when > GWndHandlerPool is not assigned and yet used. This exception could say > something like: "Program error: You should move OverbyteIcsWndControl in > front of dpr uses clause". This exception is likely to be seen by the > developer before delivering his application. This is probably better than > delivering an application silently shutting down an issue ! > > What do you think ?
I quite don't like this method either actually. Imagine this situation: Application uses a third party precompiled BPL This BPL uses ICS statically Application encounters the above problem Now, the developer of the application has to figure out where it comes from, figure out what ICS is, download it, install it and modify its program to cope with the issue. If the supplier of the BPL is not helpful, it can take days to figure this out. Silently shutting down the issue is not necessarily a good thing either, I agree. However, there should be a way to know that there still are sockets around. When there are, the finalization block does nothing and when the last socket goes away, it should do the cleanup that could not be done earlier. I'll try to figure out a way to do this and will submit a patch when I get it working properly. Regards 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