Re: [libvirt] [PATCH] Domain Events Python Bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Daniel Veillard wrote on 10/29/2008 01:09 PM:
>> +    /* Call the Callback Dispatcher */
>> +    pyobj_ret = PyObject_CallMethod(pyobj_conn_inst,
>> +                                    (char*)"dispatchDomainEventCallbacks",
>> +                                    (char*)"Oi",
>> +                                    pyobj_dom_inst,
>> +                                    event);
>> +
>> +    Py_DECREF(pyobj_dom_inst);
>> +    Py_DECREF(pyobj_conn_inst);
> 
>   We should make clear that the python callback can't keep any reference
> to the domain.
>   Maybe the solution is to pass a name or UUID string and let the python
> user do the lookup, might also avoid the object duplication (but then
> the user will do the dictionary of domains and get into the same
> problems of object lifetime).... I hate asynch interfaces :-)
> 

If the callback keeps a reference, then python will reference count it, and this will not get garbage collected until it gives up the last reference... am I misunderstanding something?

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]