dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

Timestream causes game to hang on exit

Open robob27 opened this issue 4 months ago • 1 comments

OS: Windows 11 Version: adv-beta@cb33efa8a78d7f0477f1adc2cf5dd1bd50edc28b - I'm guessing this is only an issue with the C++ port because I don't have this problem on the latest actual release using the same saves to test, and the port hasn't been released yet.

Steps to reproduce

  • Load a save with timestream enabled
  • Quit back to the main menu (saving vs not saving doesn't matter)
  • Exit the game
  • The process hangs and has to be forcibly closed

I tried to confirm that this is related to timestream with the following test:

  • Load the save with timestream enabled
  • Run disable timestream and create a new copy of the save so we'll have a copy of this save without timestream enabled
  • Exit the game. The process still hangs on exit here even though timestream was disabled but..
  • Load up the new save we just made with timestream disabled again and exit the game from there - the process doesn't hang

After asking about this in support I found that the EventManager::unregisterAll(plugin_self); call in timestream is not happening on map unload because the unload function calls plugin_enable(out, false) but then hits this condition and returns before getting to the unregistering. I tried updating it so that the unregistering happened properly on unload, and despite being able to see the handlers for timestream getting disabled, the game still seemed to hang on exit. I observed the handlers getting removed on unload with my changes using debugfilter set Debug eventmanager

robob27 avatar Oct 14 '24 01:10 robob27