Weakref breaks lambda callbacks
Bug #403901 reported by
Adam Olsen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Exaile |
Won't Fix
|
Critical
|
reacocard |
Bug Description
Weakref breaks lambda callbacks, for instance:
event.add_
That lambda function will never be called. This happens regardless of the new gobject.idle_add changes - I tried it in an older revision pre-gobject.
I have the suspicion that it doesn't work for inner functions either, for example:
def _connect_
def queue_playlist_
queue_playlist_draw never gets called. I cannot tell if this is due to the weakref or the idle_add stuff.
tags: | added: add event idle weakref |
Changed in exaile: | |
status: | New → Confirmed |
To post a comment you must log in.
This is by the nature of weakrefs - if there is no other reference to the callback, it disappears. Thus you can only use a lambda if it is assigned to a variable or some other reference is kept to it outside of event.