Skip to content

Initialize Self to null pointer to use with std::make_shared#1329

Merged
kylebaron merged 1 commit intomainfrom
fix/regimen
Feb 17, 2026
Merged

Initialize Self to null pointer to use with std::make_shared#1329
kylebaron merged 1 commit intomainfrom
fix/regimen

Conversation

@kylebaron
Copy link
Collaborator

AFAIK, evt::regimen is working fine. However, I just discovered that I can't make a shared pointer for this object (std::shared_ptr()) because of the way the object is initialized. Recall that we have to do some of these gymnastics because the objects need to be declared outside of any function so they are global to the model translation unit. And, because we need to "refresh" the object with every individual, we just declare the object and then write init() or reset() methods to refresh.

I found that initializing *Self to nullptr allows us to successfully make the shared pointer. I don't know of a way to test this, so I'm just putting it out there and letting the existing tests handle it.

@kylebaron kylebaron requested a review from kyleam February 13, 2026 22:51
@kylebaron kylebaron merged commit 87c7f85 into main Feb 17, 2026
7 checks passed
@kylebaron kylebaron deleted the fix/regimen branch February 17, 2026 19:04
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.

2 participants