[Gambas-user] How to free an object with an active ServerSocket?

Benoît Minisini g4mba5 at gmail.com
Tue Dec 8 01:07:20 CET 2020


Le 08/12/2020 à 00:21, T Lee Davidson a écrit :
> I have a project using a class that implements a ServerSocket.
> In Form_Close(), set the object variable to Null so the object's _free 
> method will get called.
> But, with a ServerSocket actively Listening in that object, the _free 
> method does not get called.
> 
> Is this by design? Am I doing something wrong? What is the proper manner 
> in which to free an object with an active server?
> 

It's the contrary. As Listen() references the SocketServer object, you 
must call the Close() method so that it can be freed later. You should 
never have to implement the _free() method.

Regards,

-- 
Benoît Minisini


More information about the User mailing list