Merge lp:~widelands-dev/widelands/bug-1818494-reset-zoom-crash into lp:widelands
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 9011 | ||||
Proposed branch: | lp:~widelands-dev/widelands/bug-1818494-reset-zoom-crash | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
48 lines (+19/-1) 2 files modified
src/editor/tools/history.cc (+8/-0) src/graphic/gl/fields_to_draw.cc (+11/-1) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-1818494-reset-zoom-crash | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Klaus Halfmann | code reieww, compile, testing | Approve | |
Review via email: mp+364208@code.launchpad.net |
Commit message
Fix/catch some memory issues
- Limit the editor undo stack to 500 items
- In fields_to_draw, make sure not to resize the vector to more memory than available,
because this can crash when zooming out.
Simply skip the unavailable bottom fields when drawing and log it.
Description of the change
This should help with a crash that a user experienced when using the editor for a long time or playing long games, then zooming out.
The problem is that Widelands doesn't have enough memory allocated to grow the vector to the required size in fields_
The problem happens only after a long time -> I found that the editor's "Undo" stack is unlimited, so I have putting an arbitrary cap on that.
No solution for the in-game memory consumption yet. We do have steadily growing containers there which are the statistics, but that can't be helped. There might be others that we haven't found yet though.
Wow, we should get the Map(s) this user created :-)
To reproduce the first problem we should edit the biggest maxium possible
map with as many objects a possible and zomm out and in like mad.
Never restart to get the overflow in that undo stack?.
An in a normal game this could happen, too?
Can we perhaps limit the maximum Zoom-factor to avoid this?
Some questions / comments inline.