[petsc-dev] XXDestroy() can be called more than once while changing type through an indirect type name

Jed Brown jedbrown at mcs.anl.gov
Mon Feb 13 19:42:40 CST 2012


On Mon, Feb 13, 2012 at 00:42, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> An alternative is to make clear vec->ops->destroy after calling it. This
> seems more robust, so I'm inclined to do it.
>

I chose this version, let me know if you prefer the more radical variant.

http://petsc.cs.iit.edu/petsc/petsc-dev/rev/1262149b3e20


>
> A more radical alternative is to zero the whole vtable. Are there use
> cases where the user wants to change the type, but still expects some of
> their own MatOps to not be overwritten when changing the type?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120213/157741b1/attachment.html>


More information about the petsc-dev mailing list