Null Pointer Exceptions for Zone fields occuring during Campaign Load and Auto Save #1267
Labels
bug
tested
This issue has been QA tested by someone other than the developer.
thread-safety
Thread Safety Issues that need to be addressed
Describe the bug
During both Campaign Load and Auto Save a null pointer exception occurs some times when the Zone is accessing its fields. This is due to the inherent lack of thread safety in Campaign/Zone/(you could keep going most of the way down) which results in other threads "seeing these fields before seeing the completion of initialisation of these objects".
While this is down to the the lack of thread safety in these classes the code for auto saving has comments saying that because the copy happens on EDT it is safe. This comment is completely incorrect, this does nothing to address the threading issues at all. For clarity sake multithreading issues/bugs are not just limited to concurrent access issues but also encompass state visibility.
While there is a larger issue of how exactly state persistence should work in a threaded environment where state can change during the saving process to be had (I have created issues #1263 and #1264 for this). A shorter term solution is also required to address the null pointer/incomplete object initialization problem.
The text was updated successfully, but these errors were encountered: