Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarf Fortress 50.15 Released  (Read 7969 times)

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Dwarf Fortress 50.15 Released
« on: December 12, 2024, 04:44:29 am »

Download (Click refresh on your browser if it doesn't show up)

Release notes for 50.15 (December 12, 2024)

Graphics additions/changes
   (*) Expanded graphics for containers
   (*) Added ability to view worn clothing by dye or by profession
   (*) Shields in right arms displayed in correct order

Major bug fixes
   (*) Fixed crash in Linux related to object pools

Other bug fixes/tweaks
   (*) Added some safeguards to ages of generated migrant children
   (*) Made tutorial close button behave consistently when tutorial is minimized
   (*) Made the agitation decay setting work properly
   (*) Removed case sensitivity on unit filters
   (*) Fixed some issues with list sorting
   (*) Fixed crash related to possible null building in sheets
   (*) Fixed a crash with creature variation mods
   (*) Fixed some threading issues in unit loops
   (*) Fixed problem with mod version compatibility setting
   (*) Fixed command line world generation
   (*) Made game respect caste population ratio in more places
   (*) Fixed some possible null pointer references
   (*) Added more information to crash log headers
Logged
The Toad, a Natural Resource:  Preserve yours today!

jecowa

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress 50.15 Released
« Reply #1 on: December 12, 2024, 10:30:20 am »

Major bug fixes
   (*) Fixed crash in Linux related to object pools

Was curious about it and looked up Object Pools on Wikipedia:
Quote from: Wikipedia
The object pool pattern is a software creational design pattern that uses a set of initialized objects kept ready to use – a "pool" – rather than allocating and destroying them on demand. A client of the pool will request an object from the pool and perform operations on the returned object. When the client has finished, it returns the object to the pool rather than destroying it; this can be done manually or automatically.
Object pools are primarily used for performance: in some circumstances, object pools significantly improve performance. Object pools complicate object lifetime, as objects obtained from and returned to a pool are not actually created or destroyed at this time, and thus require care in implementation.

What was the bad thing happening with Object Pools in Linux?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Dwarf Fortress 50.15 Released
« Reply #2 on: December 14, 2024, 07:47:07 pm »

Because of the somewhat unfortunate setup we have for g_src (I'd rather it be a subrepository in hindsight but I'd already set it up before I thought of that, whoops), there's no specific commit, but it was entirely in pool.h, which I've linked the blame to, there.

Basically, the issue was that there was some double-freeing somewhere because the object pools were using std::unique_ptrs to arrays instead of raw pointers to arrays. I quickly realized that, since the object pools (and thus the unique_ptrs they own) are only being deleted when the program closes and all the memory is freed anyway, I can just let it leak and the OS can clean it up when the program closes, which is a perfectly ordinary thing to do.
« Last Edit: December 14, 2024, 07:49:41 pm by Putnam »
Logged

jecowa

  • Bay Watcher
    • View Profile
Re: Dwarf Fortress 50.15 Released
« Reply #3 on: December 14, 2024, 09:43:22 pm »

Leaking memory sounds naughty
Logged