I solved a bug today after almost five weeks of effort. What was happening was the CPU on the client machine was spiking (at 50 to 100 percent) after I disposed of a JDialog box twice in a row.
I actually disposed of it in the object and then in the method that created the object, a stupid bug. It took me a while to find it because instead of causing a null pointer exception, I would see in process explorer lots of CSWITCH Deltas associated with MSVCR71.dll.
Using a profiler led me to the right solution.
My questions:
-
Why didn’t I get a null pointer exception?
-
What was the connection between the high CPU and the CSWITCH Deltas?
-
Why would trying to dispose a dialog box twice cause this?
Thanks,
Elliott
The heavyweight peer
Windowthat is the parent of theJDialogis managed by the host operating system.There is no null pointer exception because that is in Java, not the host OS.
The connection lies in
dispose(), which communicates with the host OS via JNI.I suspect, but cannot prove, that the affected
.dllis to blame.