Skip to content

Fix kickmap pointer problem#39

Merged
xresende merged 1 commit intomasterfrom
fix-kickmaps-list-pointer
Jul 12, 2021
Merged

Fix kickmap pointer problem#39
xresende merged 1 commit intomasterfrom
fix-kickmaps-list-pointer

Conversation

@xresende
Copy link
Copy Markdown
Contributor

@xresende xresende commented Jul 5, 2021

fixed a lurking bug with how kickmaps were used. This bug showed up only when distinct kickmaps were used, depending on the c++ compile version/implementation.

previously each Element object had a Kicktable pointer to the corresponding kicktable object. These kicktable objects are added to a Kicktable vector when a new one is defined. It turned out that, depending on the version of the C++ compiler, when a new kicktable object is added to the vector, previous ones could have their objects moved in memory, thus receiving a new object pointer and thus invalidating pointers registered in Element objects.

Instead of using a Kicktable pointer now the index into the vector is registered instead.

@xresende xresende changed the title Fix kickmap pointer changing when new kickmaps are added to kicktable… Fix kickmap pointer problem Jul 5, 2021
@xresende xresende marked this pull request as ready for review July 5, 2021 15:07
@xresende xresende merged commit 40ff24b into master Jul 12, 2021
@xresende xresende deleted the fix-kickmaps-list-pointer branch July 12, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants