1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 06:52:34 +02:00

Fix unit test 'LoaderDFF/test_clump_clone'.

This test crashed apparently only on macOS, although it should have not
worked on Linux as well as it exhibits undefined behavior

Anyway, the cause was passing a uninitialized variable into OpenGL as a
buffer id. Just initialize it with 0 (reserved 'no object' id) and check
before using it.
This commit is contained in:
Christoph Heiss 2018-02-10 15:23:04 +01:00 committed by Daniel Evans
parent fd2637f5be
commit bbf0752a3d

View File

@ -7,11 +7,13 @@
#include <glm/gtc/matrix_transform.hpp>
Geometry::Geometry() : flags(0) {
Geometry::Geometry() : EBO(0), flags(0) {
}
Geometry::~Geometry() {
glDeleteBuffers(1, &EBO);
if (EBO) {
glDeleteBuffers(1, &EBO);
}
}
ModelFrame::ModelFrame(unsigned int index, glm::mat3 dR, glm::vec3 dT)