[Mesa-dev] [PATCH 1/1] clover: Add explicit virtual destructors to argument and scalar_argument class

Jan Vesely jan.vesely at rutgers.edu
Fri May 4 16:21:20 UTC 2018


These are needed to destroy the v vector.
Fixes memory leaks on kernel launch.
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 src/gallium/state_trackers/clover/core/kernel.hpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/state_trackers/clover/core/kernel.hpp b/src/gallium/state_trackers/clover/core/kernel.hpp
index 4ba6ff467b..218f92cb1d 100644
--- a/src/gallium/state_trackers/clover/core/kernel.hpp
+++ b/src/gallium/state_trackers/clover/core/kernel.hpp
@@ -93,6 +93,7 @@ namespace clover {
          /// Free any resources that were allocated in bind().
          virtual void unbind(exec_context &ctx) = 0;
 
+         virtual ~argument() {};
       protected:
          argument();
 
@@ -143,6 +144,7 @@ namespace clover {
       class scalar_argument : public argument {
       public:
          scalar_argument(size_t size);
+         virtual ~scalar_argument() {};
 
          virtual void set(size_t size, const void *value);
          virtual void bind(exec_context &ctx,
-- 
2.17.0



More information about the mesa-dev mailing list