Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing a bug: setParameter backward compatibility issue after recent commit #1078

Merged
merged 1 commit into from Dec 5, 2022

Conversation

MassimoPetracca
Copy link
Contributor

@mhscott here's the PR related to the issue #1072

After the recent commit b15a2e5, the ElementStateParameter was added to the domain the first time with a tag = 0.

The second time "setParameter" is called, it will be ignored because a parameter with tag = 0 already exists.
However, it also generated a seg-fault in the wipeModel, because the ElementStateParameter was added to the domain, but in the setParameter command, the ElementStateParameter is passed as a pointer to a temporary.

Now it is fixed (in both Python and Tcl) just by:

  1. generating a temporary TAG for the new parameter
  2. removing the parameter before exiting the command.

To do so, however, I had to do a minor change to the ElementStateParameter class, because it did not accept a tag in the constructor

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.

None yet

2 participants