[Ohrrpgce] SVN: teeemcee/11775 sliceedit: Fix memory corruption every time you switched collections!!!!

subversion at HamsterRepublic.com subversion at HamsterRepublic.com
Sun Apr 26 10:00:44 PDT 2020


teeemcee
2020-04-26 10:00:43 -0700 (Sun, 26 Apr 2020)
762
sliceedit: Fix memory corruption every time you switched collections!!!!!!

It turns out that every time you switched from a collection with slices in it to
any other, slice_editor_mouse_over() wrote to memory using stale
slicemenu(idx).handle pointers. I have no idea why it was so hard to get it to
crash (I still haven't seen it myself), but that memory was definitely freed.
Strangely valgrind didn't flag it either.

I double fixed it by both erasing slicemenu() so there's no stale pointers, and
not calling slice_editor_mouse_over before refreshign the menu.  I may also have
been possible to access deleted slices after switching colleiction using
ses.curslice. Not anymore. Wow, pointers are dangerous.

Crashrpt a08bb1b1, and earlier reported by Sword.
---
U   wip/sliceedit.bas
U   wip/whatsnew.txt


More information about the Ohrrpgce mailing list