Skip to content

Commit b7182d5

Browse files
Updating blast to 5.0.3
### Bugfixes - Fixed memory leak in NvBlastExtAuthoringFindAssetConnectingBonds reported in issue #185.
1 parent a2af52e commit b7182d5

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

blast/VERSION.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.2
1+
5.0.3

blast/docs/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [5.0.3] - 1-November-2023
4+
5+
### Bugfixes
6+
- Fixed memory leak in NvBlastExtAuthoringFindAssetConnectingBonds reported in issue #185.
7+
8+
39
## [5.0.2] - 25-July-2023
410

511
### Bugfixes

blast/include/extensions/authoring/NvBlastExtAuthoring.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,19 @@ descriptor arrays returned. The user must free this memory after use with NVBLAS
274274
275275
\param[in] components An array of assets to merge, of size componentCount.
276276
\param[in] scales If not NULL, an array of size componentCount of scales to apply to the geometric data in
277-
the chunks and bonds. If NULL, no scaling is applied. \param[in] rotations If not NULL, an array of size
278-
componentCount of rotations to apply to the geometric data in the chunks and bonds. The quaternions MUST be normalized.
279-
If NULL, no rotations are applied.
277+
the chunks and bonds. If NULL, no scaling is applied.
278+
\param[in] rotations If not NULL, an array of size componentCount of rotations to apply to the geometric data
279+
in the chunks and bonds. The quaternions MUST be normalized. If NULL, no rotations are applied.
280280
\param[in] translations If not NULL, an array of of size componentCount of translations to apply to the
281-
geometric data in the chunks and bonds. If NULL, no translations are applied. \param[in] convexHullOffsets For each
282-
component, an array of chunkSize+1 specifying the start of the convex hulls for that chunk inside the chunkHulls array
283-
for that component. \param[in] chunkHulls For each component, an array of CollisionHull* specifying the
284-
collision geometry for the chunks in that component. \param[in] componentCount The size of the components and
285-
relativeTransforms arrays.
281+
geometric data in the chunks and bonds. If NULL, no translations are applied.
282+
\param[in] convexHullOffsets For each component, an array of chunkSize+1 specifying the start of the convex hulls for that
283+
chunk inside the chunkHulls array for that component.
284+
\param[in] chunkHulls For each component, an array of CollisionHull* specifying the collision geometry for the
285+
chunks in that component.
286+
\param[in] componentCount The size of the components and relativeTransforms arrays.
286287
\param[out] newBondDescs Descriptors of type NvBlastExtAssetUtilsBondDesc for new bonds between components.
287288
\param[in] maxSeparation Maximal distance between chunks which can be connected by bond.
289+
288290
\return the number of bonds in newBondDescs
289291
*/
290292
NV_C_API uint32_t NvBlastExtAuthoringFindAssetConnectingBonds(

blast/source/sdk/extensions/authoring/NvBlastExtAuthoring.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ CollisionHull* NvBlastExtAuthoringTransformCollisionHull(const CollisionHull* hu
172172
{
173173
CollisionHull* ret = new CollisionHull(*hull);
174174
ret->points = SAFE_ARRAY_NEW(NvcVec3, ret->pointsCount);
175-
ret->indices = SAFE_ARRAY_NEW(uint32_t, ret->indicesCount);
175+
ret->indices = SAFE_ARRAY_NEW(uint32_t, ret->indicesCount);
176176
ret->polygonData = SAFE_ARRAY_NEW(HullPolygon, ret->polygonDataCount);
177177
memcpy(ret->points, hull->points, sizeof(ret->points[0]) * ret->pointsCount);
178178
memcpy(ret->indices, hull->indices, sizeof(ret->indices[0]) * ret->indicesCount);
@@ -571,8 +571,14 @@ uint32_t NvBlastExtAuthoringFindAssetConnectingBonds
571571
//Don't need this anymore
572572
NVBLAST_FREE(newBonds);
573573

574+
// These hulls were generated by NvBlastExtAuthoringTransformCollisionHull, which uses SAFE_ARRAY_NEW
575+
// to allocate the arrays referenced in each hull. Be sure to delete the array pointers here before
576+
// deleting the CollisionHull structs.
574577
for (CollisionHull* hull : hullsToRelease)
575578
{
579+
SAFE_ARRAY_DELETE(hull->indices);
580+
SAFE_ARRAY_DELETE(hull->points);
581+
SAFE_ARRAY_DELETE(hull->polygonData);
576582
delete hull;
577583
}
578584

0 commit comments

Comments
 (0)