[GRASS-dev] [GRASS-SVN] r69248 - grass/trunk/gui/wxpython/tplot

Vaclav Petras wenzeslaus at gmail.com
Wed Aug 24 08:18:54 PDT 2016


On Wed, Aug 24, 2016 at 10:52 AM, Luca Delucchi <lucadeluge at gmail.com>
wrote:

> thanks Vaclav, god to know... but I think it could be correct that
> function should be called before it will be destroyed
>

__del__ in Python is complicated. I'm not sure what is the correct way to
use it. I only know that if you want to release resource, you should call
close(), free(), release(), Destroy() or whatever is the name. One doesn't
call __del__() explicitly on the object itself.


>
> However we have __del__ function in several gui classes
>
>
> I didn't check all but for example animation/frame.py is identical to
> tplot/frame.py
> If we decide to rename __del__ function I could do that
>

No, each case might be different. Although some revision might be useful,
there is no other case where object would call __del__ on itself
(`self.__del__`):

grep -Irn "self.__del__"

But what might be happening in the current code is that the resources are
not released but that requires case-by-case investigation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160824/ddd060fe/attachment.html>


More information about the grass-dev mailing list