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

Francisco Jerez currojerez at riseup.net
Fri May 4 17:56:53 UTC 2018


Jan Vesely <jan.vesely at rutgers.edu> writes:

> 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() {};

This line shouldn't be necessary.  With that fixed:

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

Thanks!

>  
>           virtual void set(size_t size, const void *value);
>           virtual void bind(exec_context &ctx,
> -- 
> 2.17.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180504/7c200ca9/attachment.sig>


More information about the mesa-dev mailing list