Re: [java-gnome-hackers] WeakReferences going away
Brought to you by:
afcowie
From: Philip A. C. <pch...@pc...> - 2003-02-27 17:14:59
|
On Thu, 2003-02-27 at 10:38, Tom Ball wrote: > It appears that org.gnu.gtk is misusing the WeakReference class to store > its event listeners. On my system, widgets that are initially > responsive to events quickly stop being responsive, even with simple > Java-GNOME example apps. The problem is that the app's event listeners > are being GC'd even though the widgets they are listening to are still > live. >=20 > Unless anyone objects soon, I want to check in this "WeakReference-free" > delta. Tom, The original thought was to protect from memory leaks. The problem is that sometimes developers do not call the remove method to remove their listener before releasing all other references in their code to the listener object. This leaves the reference in the listener list as the only reference to the listener and the listener is never garbage collected. Granted, this is a developer issue in that they *should* always call the remove method first. The hope was to give some protection against such sloppy programming from causing big problems. If it's causing too much trouble, can it be reworked? If not, I'd say remove it. Maybe the idea was too altruistic. BTW, Off topic: I've been away for quite a while because of insane work schedules. I'm hoping to get involved again in the next few weeks.=20 What is still outstanding to be done? --=20 Philip A. Chapman Application Development: Java, Visual Basic (MCP), VB for Applications, PostgreSQL, MySQL, MSSQL Linux, Windows 9x, Windows NT, Windows 2000, Windows XP |