Fix a crash when a value is edited in a floating variable display.
commitddad5d9f433e9188ec8d036753a2b3854f14b48a
authorJohannes Sixt <johannes.sixt@telecom.at>
Sat, 3 Feb 2007 20:33:38 +0000 (3 21:33 +0100)
committerJohannes Sixt <johannes.sixt@telecom.at>
Sat, 3 Feb 2007 20:33:38 +0000 (3 21:33 +0100)
tree5d3b80f04e18db02df93a02bb4120b997f619935
parent752aae9855f0b63c1b3f551b5d5c8ef945b56937
Fix a crash when a value is edited in a floating variable display.

Says Giuseppe Passino:

 * I've opened KDbg with the "Locals" window floating (i.e., not attached
   to the KDbg main window).
 * I've [...] "edit value" on a member (leaving the value selected)
 * I've clicked step out (note that the "edit value" box stays opened in
   the "Locals" window)

Now clicking somewhere in the Locals window crashes KDbg. The reason is
that by clicking on the "Step out" button, the edit window lost the focus,
but in a way in which we would not close it ("ActiveWindow"). Furthermore,
there is no mechanism in place the removes the edit if the edited item
goes away. Activating the Locals window again by clicking somewhere in it
first transfers the focus back to the edit, then out again, but this time
in a manner where the edit is closed. However, the edited item has already
vanished. Crash!

We avoid the situation by canceling the edit if a different window is
activated.
kdbg/exprwnd.cpp