-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Drop trigger objects when triggers are deleted or failed to be created #2098
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
src/governance-classes.cpp
Outdated
| trigger_m_it it = mapTrigger.begin(); | ||
| while(it != mapTrigger.end()) { | ||
| bool remove = false; | ||
| CGovernanceObject* pObj = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we try to use nullptr in these places instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-utACK, good catch
dashpay#2098) * Mark an object for deletion when the corresponding trigger is deleted * Mark objects for deletion if creation of corresponding triggers failed * NULL -> nullptr * Make sure pObj is not null
dashpay#2098) * Mark an object for deletion when the corresponding trigger is deleted * Mark objects for deletion if creation of corresponding triggers failed * NULL -> nullptr * Make sure pObj is not null
Otherwise we are going to have some of these objects (and their votes) in memory forever.