Closed GoogleCodeExporter closed 9 years ago
Again, let me apologize for the delay.
> Having the timer collected in the line above is harmless as the dealloc
> calls the ev_timer_stop call, but it's unorthodox behavior for Python app
> to introduce concerns about object ownership and garbage collection.
Well, I would argue the opposite :)
If I do not own a reference to an object I expect the garbage collector to free
it as
soon as possible. In fact, I got so used to this behaviour that I often find
myself
writing txt = open("/path/to/file", "r").read() knowing that the file will be
closed
and collected as soon as it has been read. I know, the situation is a bit
different
here but I couldn't find an example that would support your position in python
core
or std lib.
On a side note I tried, in early versions of pyev written with pyrex, to
implement
what you suggest, it ended up in a mess of ref management and memleaks (what
happens
if you never call stop() on a watcher to which you own a ref?, etc).
Marking this as invalid. You can reopen if you feel like it, but please come up
with
a usage example from core that would support your "unorthodox behavior" claim :)
Thanks for the report
malek
Original comment by lekma...@gmail.com
on 12 Mar 2009 at 2:23
Original issue reported on code.google.com by
g%rre.tt@gtempaccount.com
on 14 Feb 2009 at 3:31