This is caused by the MatAXPY updates (TS uses MatAXPY more than elsewhere), but isn't Shri's fault. MatHeaderReplace(A,B) did not preserve the reference count of A. I fixed this in c41b34d038d0. I'm not sure if this should be backported to release, but MatHeaderReplace is used in a few places and I have to expect that all uses are erroneous. i would also lean towards requiring that B have a reference count of exactly one, because otherwise calling this function necessarily leaves a hanging reference.
Jed
