Skip to content

Commit

Permalink
Updating blast to 5.0.3
Browse files Browse the repository at this point in the history
### Bugfixes
- Fixed memory leak in NvBlastExtAuthoringFindAssetConnectingBonds reported in issue #185.
  • Loading branch information
nvidia-bgaldrikian committed Nov 12, 2023
1 parent a2af52e commit b7182d5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion blast/VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.2
5.0.3
6 changes: 6 additions & 0 deletions blast/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [5.0.3] - 1-November-2023

### Bugfixes
- Fixed memory leak in NvBlastExtAuthoringFindAssetConnectingBonds reported in issue #185.


## [5.0.2] - 25-July-2023

### Bugfixes
Expand Down
18 changes: 10 additions & 8 deletions blast/include/extensions/authoring/NvBlastExtAuthoring.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,17 +274,19 @@ descriptor arrays returned. The user must free this memory after use with NVBLAS
\param[in] components An array of assets to merge, of size componentCount.
\param[in] scales If not NULL, an array of size componentCount of scales to apply to the geometric data in
the chunks and bonds. If NULL, no scaling is applied. \param[in] rotations If not NULL, an array of size
componentCount of rotations to apply to the geometric data in the chunks and bonds. The quaternions MUST be normalized.
If NULL, no rotations are applied.
the chunks and bonds. If NULL, no scaling is applied.
\param[in] rotations If not NULL, an array of size componentCount of rotations to apply to the geometric data
in the chunks and bonds. The quaternions MUST be normalized. If NULL, no rotations are applied.
\param[in] translations If not NULL, an array of of size componentCount of translations to apply to the
geometric data in the chunks and bonds. If NULL, no translations are applied. \param[in] convexHullOffsets For each
component, an array of chunkSize+1 specifying the start of the convex hulls for that chunk inside the chunkHulls array
for that component. \param[in] chunkHulls For each component, an array of CollisionHull* specifying the
collision geometry for the chunks in that component. \param[in] componentCount The size of the components and
relativeTransforms arrays.
geometric data in the chunks and bonds. If NULL, no translations are applied.
\param[in] convexHullOffsets For each component, an array of chunkSize+1 specifying the start of the convex hulls for that
chunk inside the chunkHulls array for that component.
\param[in] chunkHulls For each component, an array of CollisionHull* specifying the collision geometry for the
chunks in that component.
\param[in] componentCount The size of the components and relativeTransforms arrays.
\param[out] newBondDescs Descriptors of type NvBlastExtAssetUtilsBondDesc for new bonds between components.
\param[in] maxSeparation Maximal distance between chunks which can be connected by bond.
\return the number of bonds in newBondDescs
*/
NV_C_API uint32_t NvBlastExtAuthoringFindAssetConnectingBonds(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ CollisionHull* NvBlastExtAuthoringTransformCollisionHull(const CollisionHull* hu
{
CollisionHull* ret = new CollisionHull(*hull);
ret->points = SAFE_ARRAY_NEW(NvcVec3, ret->pointsCount);
ret->indices = SAFE_ARRAY_NEW(uint32_t, ret->indicesCount);
ret->indices = SAFE_ARRAY_NEW(uint32_t, ret->indicesCount);
ret->polygonData = SAFE_ARRAY_NEW(HullPolygon, ret->polygonDataCount);
memcpy(ret->points, hull->points, sizeof(ret->points[0]) * ret->pointsCount);
memcpy(ret->indices, hull->indices, sizeof(ret->indices[0]) * ret->indicesCount);
Expand Down Expand Up @@ -571,8 +571,14 @@ uint32_t NvBlastExtAuthoringFindAssetConnectingBonds
//Don't need this anymore
NVBLAST_FREE(newBonds);

// These hulls were generated by NvBlastExtAuthoringTransformCollisionHull, which uses SAFE_ARRAY_NEW
// to allocate the arrays referenced in each hull. Be sure to delete the array pointers here before
// deleting the CollisionHull structs.
for (CollisionHull* hull : hullsToRelease)
{
SAFE_ARRAY_DELETE(hull->indices);
SAFE_ARRAY_DELETE(hull->points);
SAFE_ARRAY_DELETE(hull->polygonData);
delete hull;
}

Expand Down

0 comments on commit b7182d5

Please sign in to comment.