Only call removeAction on the CompOption destructor and not the CompOption::Value destructor, since plugins that make copies of CompOption::Value can cause actions to be added through setOptionForPlugin and then those actions will be removed when the value temporary goes away.
The action adding and removing only happens within the bounds of CompOption anyways, so its its more appropriate to have it in its destructor.
Of course, this brings up another issue, which is that CompOption should be noncopyable but this opens up a whole another can of worms.