Fix a hidden bug which makes argument list grow longer for ever.
author Jekyll Wu
()
committer Kurt Hindenburg
()
commit 27d65589b4c6a71a08d2d4f674177e96738d56a7
tree 66a4f7a47ec129388137fcbb7191d2eb4b84c00b
parent b13b252e6f72916030ba10ad7c1dde5c516ffd09
Fix a hidden bug which makes argument list grow longer for ever.

The old code updates the argument list when it is asked to refresh
process info, but it calls ProcessInfo::addArgument() without ever
clearing existing arguements first. This means the argument list will
grow longer and longer for ever. For a long-running shell session in
which user has executed thousands of commands, that will waste quite
amount of memory, not to metion the logic error itself.

The reaseon why this bug keeps hidden is that the %c and %C formatter
have never been revealed to users, which are not implemented yet.
(cherry picked from commit 20e927494337863ab9906281c11bd3ddb5387f2a)
src/ProcessInfo.cpp
src/ProcessInfo.h