>> 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 ? -- [EMAIL PROTECTED] The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be ----- Original Message ----- From: "Olivier Sannier" <[EMAIL PROTECTED]> To: "ICS support mailing" <[email protected]> Sent: Friday, October 10, 2008 3:06 PM Subject: Re: [twsocket] GWndHandlerPool is freed before sockets are destroyed > Hello, > > Francois Piette wrote: >> you add OverbyteIcsWndControl in front (well after other higher priority >> units such as FastMM4) of the dpr uses clause, the issue should go away. >> Please check and tell me what. >> > Yes, it works. But I don't really like having "useless" uses in the dpr, > and this is not an obvious solution for most people. What I'm saying > here is that the case I'm encountering could be quite frequent because > it is an application of the class factory pattern. > >> 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. > One advantage that I see to the proposed fix is that it allows smooth > transition for most users, and for those in the case above, they should > have enough knowledge to figure out the solution by themselves. > > In the end, you're the one deciding here, but I think it would be nice > if the transition to v6/v7 was as smooth as possible. > > 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 -- 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
