64 bit crashes when deleting a control from inside an event handler on that control.
Description
Description
Details
Details
- Severity
- Minor
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Operating System Version
- 10.0.14393
- Category
- Scripting
Steps To Reproduce
- Go into a mission with debug console.
- Paste in debug console:
[] spawn { disableSerialization; sleep 2; createDialog "RscDisplayCommon"; _dialog = findDisplay 999; _control = _dialog ctrlCreate ["RscButton", 420]; _control ctrlSetPosition [0,0,1,1]; _control ctrlSetText "CRASH"; _control ctrlCommit 0; _control ctrlAddEventHandler ["MouseButtonDown", "ctrlDelete ((findDisplay 999) displayCtrl 420)"]; };
- Click local exec, and then ESC straight away (within the 2 second sleep)
- Click 'CRASH'.
Additional Information
Note the sleep/spawn etc. is just to let you close the debug console to display the dialog. Last line is the issue.
Works (deletes the control and doesn't crash) in 32bit, not 64bit.
Log entry shows:
=======================================================
Exception code: C0000094 INT_DIVIDE_BY_ZERO at 026FC05C
graphics: D3D11, Device: NVIDIA GeForce GTX 1080
Workaround is
_control ctrlAddEventHandler ["MouseButtonDown", "[] spawn {ctrlDelete ((findDisplay 999) displayCtrl 420)}"];