Closed KroArtem closed 8 years ago
Unfortunately I could neither replicate the issue nor identify what is wrong. It seems like something is wrong with the memory allocation of OverlayAnimation objects, but I'm not sure what; they aren't defined much differently from the VariationInfo objects.
I did, however, make some improvements to the OverlayAnimation code here: https://github.com/Andrettin/Wyrmgus/commit/feefe55463507ec0f9ebbe774ab2d6065056096d
Hopefully that solves the issue.
I don't know what caused the issue but thought something could be wrong with destructors: like, deleting already deleted data or something similar. If it is something in memory allocation, it'll show up during the game, not when you're exiting it. However, will try to re-check, but this will require more time.
No, the problem still exists with absolutely the same stacktrace. Moreover, it happens even if I just start Wyrmsun and exit it.
Hmm :(
Yes, it sounds like something is wrong with the destructor, but I don't see what. The deletion of the data is set up in the same way as the VariationInfo, and that one is not causing such an error.
Ok, it always refers to the same piece.
for (int i = 0; i < AnimationFrameMax; ++i) {
if (this->ShieldAnimation[i]) {
delete this->ShieldAnimation[i];
}
}
With this unit: DefineUnitType("unit-revealer", { Name = "Dummy unit",
And it doesn't seem to have any ShieldAnimation.
Thanks! "unit-revealer" is the first unit to be defined, so it makes sense that the crash would happen on it. As you mentioned though, it doesn't have any ShieldAnimation (nor does it have a parent unit type either), so I wonder how it is passing the "if (this->ShieldAnimation[i])" conditional.
I wonder if it has something to do with the OverlayAnimation class having only ints in it as variables?
Another idea - perhaps your compiler is ignoring that IF statement?
I found the reason for this issue, it was due to an error in initializing the variable. Fixed here: https://github.com/Andrettin/Wyrmgus/commit/4f222a018978c0b5a9f2d8345e882a9fdea90e83
Wyrmsun & Wyrmgus the latest. I've played custom game, defeated 3 opponents, came to main menu and pressed Exit. This is what happened: