d/ns: Fix memory leak in math

This commit is contained in:
Ryan Pavlik 2020-10-21 17:04:02 -05:00
parent 1a5dde79af
commit d4011ed78a
2 changed files with 7 additions and 6 deletions

View file

@ -0,0 +1 @@
North Star: Fix memory leak in math code.

View file

@ -120,13 +120,13 @@ public:
}
inline Vector3
operator/(const float &d)
operator/(const float &d) const
{
Vector3 *ret = new Vector3();
ret->x = (x / d);
ret->y = (y / d);
ret->z = (z / d);
return *ret;
Vector3 ret;
ret.x = (x / d);
ret.y = (y / d);
ret.z = (z / d);
return ret;
}
inline Vector3 operator*(const float &d)