| ceed-operator.c (05b44d1b5ea8b564ccb88bb14760c6e7ef0ad51a) | ceed-operator.c (ad6481ce28fcfada16ee6d8a13bbacd137fe686a) |
|---|---|
| 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8#include <ceed-impl.h> --- 1717 unchanged lines hidden (view full) --- 1726 1727 @param[in,out] op CeedOperator to destroy 1728 1729 @return An error code: 0 - success, otherwise - failure 1730 1731 @ref User 1732**/ 1733int CeedOperatorDestroy(CeedOperator *op) { | 1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3// 4// SPDX-License-Identifier: BSD-2-Clause 5// 6// This file is part of CEED: http://github.com/ceed 7 8#include <ceed-impl.h> --- 1717 unchanged lines hidden (view full) --- 1726 1727 @param[in,out] op CeedOperator to destroy 1728 1729 @return An error code: 0 - success, otherwise - failure 1730 1731 @ref User 1732**/ 1733int CeedOperatorDestroy(CeedOperator *op) { |
| 1734 if (!*op || --(*op)->ref_count > 0) return CEED_ERROR_SUCCESS; | 1734 if (!*op || --(*op)->ref_count > 0) { 1735 *op = NULL; 1736 return CEED_ERROR_SUCCESS; 1737 } |
| 1735 if ((*op)->Destroy) CeedCall((*op)->Destroy(*op)); 1736 CeedCall(CeedDestroy(&(*op)->ceed)); 1737 // Free fields 1738 for (CeedInt i = 0; i < (*op)->num_fields; i++) { 1739 if ((*op)->input_fields[i]) { 1740 if ((*op)->input_fields[i]->elem_rstr != CEED_ELEMRESTRICTION_NONE) { 1741 CeedCall(CeedElemRestrictionDestroy(&(*op)->input_fields[i]->elem_rstr)); 1742 } --- 55 unchanged lines hidden --- | 1738 if ((*op)->Destroy) CeedCall((*op)->Destroy(*op)); 1739 CeedCall(CeedDestroy(&(*op)->ceed)); 1740 // Free fields 1741 for (CeedInt i = 0; i < (*op)->num_fields; i++) { 1742 if ((*op)->input_fields[i]) { 1743 if ((*op)->input_fields[i]->elem_rstr != CEED_ELEMRESTRICTION_NONE) { 1744 CeedCall(CeedElemRestrictionDestroy(&(*op)->input_fields[i]->elem_rstr)); 1745 } --- 55 unchanged lines hidden --- |