From 688df2c60bb7d2d3ab9dfcacfd3fa663d6acb8c9 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 6 May 2019 17:13:42 -0700 Subject: [PATCH] fix exceeding shared memory usage, return of member of deleted class. --- examples/SharedMemory/SharedMemoryPublic.h | 2 +- examples/SharedMemory/plugins/grpcPlugin/grpcPlugin.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/SharedMemory/SharedMemoryPublic.h b/examples/SharedMemory/SharedMemoryPublic.h index b2c2f6c68..6c62c788e 100644 --- a/examples/SharedMemory/SharedMemoryPublic.h +++ b/examples/SharedMemory/SharedMemoryPublic.h @@ -952,7 +952,7 @@ struct b3ForwardDynamicsAnalyticsIslandData double m_remainingLeastSquaresResidual; }; -#define MAX_ISLANDS_ANALYTICS 1024 +#define MAX_ISLANDS_ANALYTICS 64 struct b3ForwardDynamicsAnalyticsArgs { diff --git a/examples/SharedMemory/plugins/grpcPlugin/grpcPlugin.cpp b/examples/SharedMemory/plugins/grpcPlugin/grpcPlugin.cpp index eb6c04d9f..7a0d4888a 100644 --- a/examples/SharedMemory/plugins/grpcPlugin/grpcPlugin.cpp +++ b/examples/SharedMemory/plugins/grpcPlugin/grpcPlugin.cpp @@ -206,7 +206,9 @@ private: { GPR_ASSERT(status_ == FINISH); // Once in the FINISH state, deallocate ourselves (CallData). + CallData tmpStatus = status_; delete this; + return tmpStatus; } return status_; }