Dungeon Crawl Stone Soup Tracker - DCSS
Viewing Issue Advanced Details
4352 Patches crash always 2011-08-04 01:38 2011-08-09 04:06
blueDave Local  
KiloByte Windows  
normal Tiles  
resolved 0.9 ancient branch  
done  
none    
none 0.9 ancient branch  
0004352: patch to fix 4339
This patch is a proposed fix for 4339. Static variable next_colour in l_colour.cc is not reset, eventually fails assert < 128. New code resets this variable when starting a new game and provides a framework which can be used to reset other statics which are used in this way.

Unit tested with GDB, confirmed variable is reset. Have not confirmed there are no side effects -- don't know what it actually controls. ;)
? file icon 0001-Changes-for-Mantis-4339.patch [^] (2,289 bytes) 2011-08-04 01:38 [Show Content]
Issue History
2011-08-04 01:38 blueDave New Issue
2011-08-04 01:38 blueDave File Added: 0001-Changes-for-Mantis-4339.patch
2011-08-09 02:50 KiloByte Note Added: 0014112
2011-08-09 03:41 KiloByte Note Added: 0014113
2011-08-09 03:41 KiloByte Status new => resolved
2011-08-09 03:41 KiloByte Fixed in Branch => 0.9 development branch
2011-08-09 03:41 KiloByte Resolution open => done
2011-08-09 03:41 KiloByte Assigned To => KiloByte
2011-08-09 04:06 blueDave Note Added: 0014115

Notes
(0014112)
KiloByte   
2011-08-09 02:50   
Sadly, this does not fix the underlying leak. There is currently only one vault with custom Lua colours though, and its global prelude is called at most once per game, so your patch does indeed work for now.

I did apply it to 0.9 but not trunk, thanks for investigating!
(0014113)
KiloByte   
2011-08-09 03:41   
... and I later reverted it, as there are problems with save compatibility: extra colours need to have the same value in every game.

I hard-coded them in 0.9 for now, and reworked related code in trunk.
(0014115)
blueDave   
2011-08-09 04:06   
Well, it was worth trying. Didn't think about save compatibility, not something I expected to be saved. Thanks for attempting to use it. :) I'll try again on another bug.