Uh oh!
There was an error while loading. Please reload this page.
Avoid using raw pointers in GetAllNewerThan results - #4649
Conversation
This Pull Request may conflict if the Pull Requests below are merged first. #4321 |
UdjinM6
commented
Dec 30, 2021
oh, wow! that's a lot of conflicting PRs for what I thought was a simple change 🙈 |
PastaPastaPasta
commented
Dec 30, 2021
Can you convert this to using weak ptr? These really shouldn't be owning |
UdjinM6
commented
Jan 3, 2022
I'm not sure how to do this without a lot of refactoring in CGovernanceManager. A suggestion (or a post-merge followup) patch is welcome :) |
how about smth like 6321798 to avoid ownership? (shared_ptr changes may still be appropriate to prevent dangling, although I don't like it) This should be okay to simply cache these values as we continually call |
PastaPastaPasta
commented
Jan 3, 2022
Also is dash/src/qt/governancelist.cpp Line 342 in 6321798 (please explain if I'm missing smth) |
PastaPastaPasta
commented
Jan 4, 2022
I would propose a solution like 8a09264 as opposed to introducing shared_ptr usage here. It basically extends the lifetime of the lock, to the lifetime of the returned vector (whose values should be considered dangling after the lock expires). as opposed to creating some 40 shared_ptrs (relatively expensive) and extending the lifetime of the governance objects themselves, we only extend the time that we were locking the mutex. (although this ReturnWithLock struct maybe should have a different name, and maybe be in a different file) |
Uh oh!
There was an error while loading. Please reload this page.
PastaPastaPasta
commented
Jan 20, 2022
Any update on this? |
PastaPastaPasta
commented
Feb 11, 2022
re, any update on this? |
9034c2c to
6167e10Comparepass copies around, fix gui updates and mem leaks
6167e10 to
f960bf3Comparepass copies around, fix gui updates and mem leaks
pass copies around, fix gui updates and mem leaks
I believe this fixed some crashes for me in GUI (with Governance tab on).