-
Notifications
You must be signed in to change notification settings - Fork 809
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
Gnc commodity cpp #2009
base: stable
Are you sure you want to change the base?
Gnc commodity cpp #2009
Conversation
Code mostly looks OK except for the last commit, see below. The first commit is dependent on the following two so it will cause crashes in bisects. The simplest fix would be to reorder it to after them but it would be more correct to combine the The last commit is wrong.
Line 2202 is
The problem is that
But consider the stupidity of the algorithm: We have an iterator in the vector. We get the string name from that iterator and search the vector again with the string to find the iterator that we already have, then convert the iterator to its object and search the vector yet again to remove the iterator. Then we destroy the object's members (ignoring its ref count and not NULLing any of them) and finally call the object's destructor ( If the object cleanup was in
Unfortunately |
76bdded
to
4711e8f
Compare
The first commit is one that makes the get_commodities and get_namespaces return GLists that must be freed by the caller, so I was actually thinking best to merge it separately first, so that this branch is purely c++ refactoring. |
4711e8f
to
f25aa84
Compare
Ah, missed the |
f25aa84
to
ae3c98a
Compare
I see the silly object cleanup code paths... and hopefully with the lesser LOC here it would be easier to simplify. |
ae3c98a
to
044fbcd
Compare
tested via add/remove custom commodity in ui