Fix memory leaks as result of missing delete[]
The delete keyword only calls a single destructor, delete[] calls as many as there are members in the array.
This commit is contained in:
@@ -593,7 +593,7 @@ void OverlayController::AddOffsetToCollisionBounds(float offset[3], bool commit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
|
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
|
||||||
delete collisionBounds;
|
delete[] collisionBounds;
|
||||||
}
|
}
|
||||||
if (commit && collisionBoundsCount > 0) {
|
if (commit && collisionBoundsCount > 0) {
|
||||||
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
||||||
@@ -621,7 +621,7 @@ void OverlayController::RotateCollisionBounds(float angle, bool commit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
|
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
|
||||||
delete collisionBounds;
|
delete[] collisionBounds;
|
||||||
}
|
}
|
||||||
if (commit && collisionBoundsCount > 0) {
|
if (commit && collisionBoundsCount > 0) {
|
||||||
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ void ChaperoneTabController::setHeight(float value, bool notify) {
|
|||||||
}
|
}
|
||||||
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
|
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
|
||||||
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
|
||||||
delete collisionBounds;
|
delete[] collisionBounds;
|
||||||
}
|
}
|
||||||
if (notify) {
|
if (notify) {
|
||||||
emit heightChanged(m_fadeDistance);
|
emit heightChanged(m_fadeDistance);
|
||||||
@@ -1006,7 +1006,7 @@ float ChaperoneTabController::getBoundsMaxY() {
|
|||||||
result = collisionBounds[b].vCorners[ci].v[1];
|
result = collisionBounds[b].vCorners[ci].v[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete collisionBounds;
|
delete[] collisionBounds;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user