[Gambas-user] _free() event not firing when object has a Handle on a Process

Benoît Minisini g4mba5 at gmail.com
Wed Feb 5 21:33:05 CET 2020


Le 02/02/2020 à 20:03, T Lee Davidson a écrit :
> I have a class (TestClass) that, in its _new() method, spawns a SHELL 
> Process with `ispell` in pipe mode:
> $pServerInstance = Shell "ispell -a"
> 
> The class also has a _free() method that kills the Process:
> If $pServerInstance Then $pServerInstance.Kill
> 
> I create an object of the class in the main form with:
> TestObject = New TestClass
> 
> But, when I destroy the object, "TestObject = Null", the _free() method 
> does not get called. This means the Process does not get killed, and the 
> application hangs.
> 
> Is this a bug, or just bad programming practice on my part?
> 
> 

It's a bug, normally fixed in commit 
https://gitlab.com/gambas/gambas/commit/d4860710c0623a9e4e9d5d7b47e2cc2e3df454e3.

Regards,

-- 
Benoît Minisini


More information about the User mailing list