<div dir="ltr">I have a situation with a c++ code where I get an error when destroying the solver context after destroying the matrix. I have the following lines at the end of my function<div><br></div><div>                 KSPDestroy(&ksp);<br>                 MatDestroy(&A);<br>                   PetscObjectDestroy((PetscObject*)&x);<br>                     PetscObjectDestroy((PetscObject*)&b);<br></div><div><br></div><div>It is a very simple program, very similar to the /ksp/ksp/ex1.c example. </div><div><br></div><div>I can destroy the solver context (ksp) or the matrix (A) but not both. Does anybody have a clue?</div><div><br></div><div>Adolfo</div><div><br></div><div> </div></div>