Merge "Fix memory leak in MultiStateCounter" into tm-dev