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:
Vasily
2018-12-27 14:23:54 +01:00
parent d9a4da5f5d
commit e7e7272d52
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -593,7 +593,7 @@ void OverlayController::AddOffsetToCollisionBounds(float offset[3], bool commit)
}
}
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
delete collisionBounds;
delete[] collisionBounds;
}
if (commit && collisionBoundsCount > 0) {
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
@@ -621,7 +621,7 @@ void OverlayController::RotateCollisionBounds(float angle, bool commit) {
}
}
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
delete collisionBounds;
delete[] collisionBounds;
}
if (commit && collisionBoundsCount > 0) {
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
@@ -486,7 +486,7 @@ void ChaperoneTabController::setHeight(float value, bool notify) {
}
vr::VRChaperoneSetup()->SetWorkingCollisionBoundsInfo(collisionBounds, collisionBoundsCount);
vr::VRChaperoneSetup()->CommitWorkingCopy(vr::EChaperoneConfigFile_Live);
delete collisionBounds;
delete[] collisionBounds;
}
if (notify) {
emit heightChanged(m_fadeDistance);
@@ -1006,7 +1006,7 @@ float ChaperoneTabController::getBoundsMaxY() {
result = collisionBounds[b].vCorners[ci].v[1];
}
}
delete collisionBounds;
delete[] collisionBounds;
}
return result;
}