VecDestroy and memory leak

Jed Brown jed at 59A2.org
Sat Nov 28 09:27:34 CST 2009


On Sat, 28 Nov 2009 15:44:19 +0100, nicolas aunai <nicolas.aunai at gmail.com> wrote:
> VecCreateSeq(PETSC_COMM_SELF, mx*my*dof, &ssol);
> VecScatterCreateToAll(nsol, &ctx, &ssol);
                                    ^^^^^

This is a new vector, the one you create on the line above is lost.
From the man page:

|     Do NOT create a vector and then pass it in as the final argument vout! vout is created by this routine
|   automatically (unless you pass PETSC_NULL in for that argument if you do not need it).


Jed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20091128/f80e60a4/attachment.pgp>


More information about the petsc-users mailing list