Commits

Jed Brown  committed 03c4025

MatHeaderReplace: fix duplicate call to PetscLogObjectDestroy

PetscLogObjectDestroy includes tallying of creations and destructions,
but MatHeaderReplace already calls PetscHeaderDestroy_Private, which
calls PetscLogObjectDestroy itself. This led to tallies with more
destructions than creations for operations when calling functions that
use MatHeaderReplace (like MatAXPY and MatAYPX).

Reported-by: Lukasz Kaczmarczyk <Lukasz.Kaczmarczyk@glasgow.ac.uk>

  • Participants
  • Parent commits 6327050

Comments (0)

Files changed (1)

File src/mat/utils/gcreate.c

 
   ((PetscObject)A)->refct = refct;
 
-  ierr = PetscLogObjectDestroy((PetscObject)C);CHKERRQ(ierr);
   ierr = PetscFree(C);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }