avoid calling a pure virtual function from GLBackend dtor

This commit is contained in:
Seth Alves 2017-08-06 12:47:45 -07:00
parent 186035dc5d
commit 6f9460162d
4 changed files with 11 additions and 3 deletions

View file

@ -196,8 +196,6 @@ GLBackend::GLBackend() {
GLBackend::~GLBackend() {
resetStages();
killInput();
killTransform();
}

View file

@ -66,7 +66,7 @@ protected:
public:
static bool makeProgram(Shader& shader, const Shader::BindingSet& slotBindings = Shader::BindingSet());
~GLBackend();
virtual ~GLBackend();
void setCameraCorrection(const Mat4& correction);
void render(const Batch& batch) final override;

View file

@ -43,6 +43,11 @@ public:
explicit GL41Backend(bool syncCache) : Parent(syncCache) {}
GL41Backend() : Parent() {}
virtual ~GL41Backend() {
// call resetStages here rather than in ~GLBackend dtor because it will call releaseResourceBuffer
// which is pure virtual from GLBackend's dtor.
resetStages();
}
static const std::string GL41_VERSION;
const std::string& getVersion() const override { return GL41_VERSION; }

View file

@ -39,6 +39,11 @@ public:
explicit GL45Backend(bool syncCache) : Parent(syncCache) {}
GL45Backend() : Parent() {}
virtual ~GL45Backend() {
// call resetStages here rather than in ~GLBackend dtor because it will call releaseResourceBuffer
// which is pure virtual from GLBackend's dtor.
resetStages();
}
static const std::string GL45_VERSION;
const std::string& getVersion() const override { return GL45_VERSION; }