SceneRefract: Fix potential memory leak
The memory leak occurs when using the scene for multiple benchmarks.
diff --git a/src/scene-refract.cpp b/src/scene-refract.cpp
index b936362..db0aec8 100644
--- a/src/scene-refract.cpp
+++ b/src/scene-refract.cpp
@@ -87,11 +87,6 @@
"false,true");
}
-SceneRefract::~SceneRefract()
-{
- delete priv_;
-}
-
bool
SceneRefract::supported(bool show_errors)
{
@@ -150,6 +145,7 @@
{
// Add scene-specific teardown here
priv_->teardown();
+ delete priv_;
Scene::teardown();
}
diff --git a/src/scene.h b/src/scene.h
index 88f839d..66377e1 100644
--- a/src/scene.h
+++ b/src/scene.h
@@ -580,7 +580,6 @@
RefractPrivate* priv_;
public:
SceneRefract(Canvas& canvas);
- ~SceneRefract();
bool supported(bool show_errors);
bool load();
void unload();