[Gambas-user] DnsClient example: never ever use _free(), right?
Tobias Boege
taboege at ...626...
Thu Jul 24 21:03:06 CEST 2014
On Wed, 23 Jul 2014, Beno?t Minisini wrote:
> No, you should not call _free(). You should even never have to implement
> it in Gambas code.
>
> The problem is that DnsClient enables its internal watch too early, and
> disables it too late.
>
> It should enable the watch the first time it is actually needed - when
> GetHostName() or GetHostIP() is called - and not when the Async property
> is set.
>
> And it should disable the watch when the async operation is terminated
> or when Stop() is called.
>
> If you can do the change, you are welcome! :-)
Done in revision #6397. I changed the provocative parts of the DnsClient
example on the way. A small test script with two asynchronous DnsClients
reports no memory leaks.
Regards,
Tobi
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list