These are chat archives for IndySockets/Indy

9th
Jan 2019
mezen
@mezen
Jan 09 09:23
Does the global variable "GWindowsStack" in unit IdStackWindows still needed? I use private, short living instances of TIdStackWindows to use HostByAddress and the protected method HostByName, but the constructor of TIdStackWindows stores Self to the global variable. Every time my short living instances are freed, the global variable still holds a dengling pointer :(
Do I have to set the global variable to nil? Or should I use a long living singleton from the global variable?
Remy Lebeau
@rlebeau
Jan 09 18:24
@mezen GWindowsStack is only used by the long-deprecated SuperCore package, so technically no, it is not needed anymore. I can mark it as deprecated when I get a chance. However, you really should not be creating your own IdStack objects at all. Use TIdStack.IncUsage() and TIdStack.DecUsage() to let Indy create/destroy its own singleton object for you, and then you can access it with GStack and/or GBSDStack as needed (Indy components do this internally).