Re: [PATCH 2/2] Ensure JNA callbacks cannot get GCed

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

 



At Wed, 26 Mar 2014 02:43:49 +0000,
Chris Ellis wrote:
> 
> Currently nothing prevents the JNA callback objects used when registering
> for domain events from being garbage collected.  JNA requires that callback
> objects are not GCed whilst they are in use by C code.
> 
> To solve this we hold a reference to the callback alongside the callback id.
> This ensures that the JNA callback objects will retain in memory while it is
> registered with the C layer.
> 
> We also use an IdentityHashMap rather than a HashMap to store the EventListener
> objects.
> ---
>  src/main/java/org/libvirt/Connect.java | 37 ++++++++++++++++++++++------------
>  1 file changed, 24 insertions(+), 13 deletions(-)

Nice catch. ACK.

Should we squash this into patch 41/65 before pushing the series?

--
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]