From b57f05dfe7b381e2df5de4ce30f8e52912bb80d3 Mon Sep 17 00:00:00 2001 From: adelhpour Date: Wed, 20 Nov 2024 11:55:29 -0800 Subject: [PATCH 1/2] The issue with 'alias_element_createAliasSpeciesReferenceGlyphs' not returning 0 on success if fixed. --- src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp b/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp index 83386f4..a558104 100644 --- a/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp +++ b/src/features/alias_elements/libsbmlnetwork_alias_reaction.cpp @@ -55,6 +55,8 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { for (unsigned int stoichiometryIndex = 0; stoichiometryIndex < stoichiometry; stoichiometryIndex++) alias_element_createAliasSpeciesReferenceGlyph(reactionGlyph, speciesReferenceGlyph, connectedSpeciesGlyph->getId(), stoichiometryIndex); + + return 0; } } } From 908146b98496f0f53ed31843211629dbcf929f91 Mon Sep 17 00:00:00 2001 From: adelhpour Date: Wed, 20 Nov 2024 13:19:11 -0800 Subject: [PATCH 2/2] freeUserData is now accessible through the C++ API once again. --- src/libsbmlnetwork_sbmldocument.cpp | 9 +++++++++ src/libsbmlnetwork_sbmldocument.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/src/libsbmlnetwork_sbmldocument.cpp b/src/libsbmlnetwork_sbmldocument.cpp index 72b5d34..76c690f 100644 --- a/src/libsbmlnetwork_sbmldocument.cpp +++ b/src/libsbmlnetwork_sbmldocument.cpp @@ -69,6 +69,15 @@ namespace LIBSBMLNETWORK_CPP_NAMESPACE { return false; } + bool freeUserData(SBMLDocument* document) { + if (document) { + user_data_freeUserData(document); + return true; + } + + return false; + } + bool isSetModel(SBMLDocument* document) { if (document) return document->isSetModel(); diff --git a/src/libsbmlnetwork_sbmldocument.h b/src/libsbmlnetwork_sbmldocument.h index 7dd5115..6326bb7 100644 --- a/src/libsbmlnetwork_sbmldocument.h +++ b/src/libsbmlnetwork_sbmldocument.h @@ -66,6 +66,11 @@ LIBSBMLNETWORK_EXTERN void clearErrorLog(SBMLDocument* document); /// @return boolean value indicating success/failure of the function. LIBSBMLNETWORK_EXTERN bool freeSBMLDocument(SBMLDocument* document); +/// @breif Free the user data of the given SBML document. +/// @param document a pointer to the SBMLDocument object. +/// @return boolean value indicating success/failure of the function. +LIBSBMLNETWORK_EXTERN bool freeUserData(SBMLDocument* document); + /// @brief Returns true if the Model object has been set, otherwise returns false. /// @param document a pointer to the SBMLDocument object. /// @return true if the Model object has been set, otherwise returns false.