#2028 closed defect (fixed)
[BUG] CInput::UpdateText() crash in Debug build
Reported by: | Jorma Rebane | Owned by: | Jorma Rebane |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 14 |
Component: | Core engine | Keywords: | patch defect |
Cc: | Patch: |
Description
In VC++11.0 or higher, CInput::UpdateText() will crash in debug build with error: Iterators incompatible.
This is due to std::list<SRow>::erase invalidating the iterators and no code to update the active iterators.
The actual fix is very simple.
Previously the code relied on undefined behavior to run.
Attachments (1)
Change History (5)
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Replying to historic_bruno:
Could we do this:
current_line = m_CharacterPositions.erase(destroy_row_from, destroy_row_to);instead of setting
current_line
before the erase? That should always be the correct, valid iterator? (it also fixes the assertion failure)
Changed and tested. Works exactly the same. New patch file added with the one-liner.
Note:
See TracTickets
for help on using tickets.
Could we do this:
instead of setting
current_line
before the erase? That should always be the correct, valid iterator? (it also fixes the assertion failure)