On Thu, Apr 2, 2009 at 4:44 PM, Phil Mc <[email protected]> wrote:
I haven't used the Mdi window classes, but I did just spend awhile trying > to get widgets to go away that turned out to still have references coming > in. I believe that DeleteOnClose won't do the expected things to a widget > that still has direct references pointing to it; that was my experience > with that flag, anyway. Hmmmm... That might indeed be the source of my problems here, since I'm constructing the subwindows from widgets returned by methods of classes that I'm dinamically loading at runtime (kind of like a plugin system), and the subwindows (note that I'm not subclassing QMdiSubWindow) are being used in another class (namely, the main window of the app). This doesn't directly address the mdi/subwindow object question, but if > you're using Eclipse, I can recommend using the Memory Analyzer Tool > (http://www.eclipse.org/mat/) to see if those widgets are truly still in > existence, and if so which other objects have references to them which > keep them alive. You just use jmap to create a heap dump, open that > binary dump file in Eclipse, and then quick clicks into the Dominator Tree > and Show as Histogram (and then filtering for the class in question) will > tell you what's actually lurking inside your JVM. This tool recently > saved my sanity on an analogous issue... Did that, got kinda lost in the huge amount of info offered by the Memory Analizer Tool, but I managed to find the QMdiSubWindow class. The bad thing is, I didn't find anything strange. The histogram doesn't even list QMdiSubWindow, even though Dominator tree does, and when I checked the objects of that class (as expected, only two objects, so I'm not unwillingly cloning anything) for incoming references, I found that both were referenced only once (at least I think so, though I might be misinterpreting the info given by the MAT). I checked the "referent" field and in both cases it shows "java.lang.ref.Finalizer". Shall I assume this means there are no dangling references? Come to think of it I made sure to close the subwindows before getting the heap dump with jmap, so maybe I shouldn't even see those two references. Furthermore, other dumps taken with the subwindows still opened show the same references. Quite puzzling, at least for me. Hope that helps a little! > -phil Thanks for your advice. I'll keep trying to solve the problem, and learn a few things about MAT just in case there is something I missed. ;) Further suggestions, advice and/or help from anyone are welcome.
_______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
