Seems like the cleanup-bug is fixed. The problem was that the WorkersQueue was 
free-ing the stored workers on cleanup while the building was also free-ing 
them. The fix is to simply drop the pointers to the workers when removing the 
queue and let the building handle them.

However, I don't really like the fix. For one thing, I could not really figure 
out which methods are called at which time during cleanup. The code I looked at 
does not matches my observations while debugging. Most likely this is a 
misunderstanding by me and no bug in the code, though.

The more serious problem is the sporadic nature of the bug. Neither my 
understanding of the bug nor the fix are accounting for the fact that the bug 
only occurs sometimes. It could happen when some code (which one?) sets the 
to-be-freed pointers to some value (which and why?) that happens to be NULL 
most of the time. Not that this makes any sense for me. Another possibility 
could be a random order of cleanup on exit.

So while the bug seems to be fixed I don't understand it and there might be a 
memory leak present now.
-- 
https://code.launchpad.net/~widelands-dev/widelands/casern_workersqueue/+merge/309763
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/casern_workersqueue into lp:widelands.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to