Skip to content

Commit

Permalink
Added nvdestroy check
Browse files Browse the repository at this point in the history
  • Loading branch information
drreynolds committed Jan 21, 2025
1 parent e899796 commit 0f2fda3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/arkode/arkode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3397,8 +3397,11 @@ int arkCheckTemporalError(ARKodeMem ark_mem, int* nflagPtr, int* nefPtr,
---------------------------------------------------------------*/
sunbooleantype arkAllocVec(ARKodeMem ark_mem, N_Vector tmpl, N_Vector* v)
{
/* return failure if N_VClone is not implemented */
if (!tmpl->ops->nvclone) { return SUNFALSE; }
/* return failure if N_VClone or N_VDestroy is not implemented */
if ((!tmpl->ops->nvclone) || (!tmpl->ops->nvdestroy))
{
return SUNFALSE;
}

/* allocate the new vector if necessary */
if (*v == NULL)
Expand Down

0 comments on commit 0f2fda3

Please sign in to comment.