I have a JFrame, and I open JDialog from it and another JDialog from this dialog - in which menas I see 3 windows (JFrame, JDialog1, Jdialog2).
When I close both dialogs and run the garbage collector several times (from the netbeans profiler), I see that JDialog2 (the one that opens from JDialog1) is the garbage collection, but JDialog1 (opened from JFrame) is still hanging in the pool of live objects.
I create new objects every time - so after a while I have an OutOfMemoryError doue leak.
Do I need to treat JDialogs in a special way so that they don't leak?
By the way, I do setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE)
in both dialogs,
source
share