From 065446d5ccdeb7bbf3af9be2f294344dc445c975 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Tue, 25 Oct 2022 15:07:14 +0100 Subject: [PATCH] Ensure GlAbstraction is not copyable Change-Id: I95f40a776255ebfbba57d9761b3660dd3984b918 --- dali/integration-api/gl-abstraction.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dali/integration-api/gl-abstraction.h b/dali/integration-api/gl-abstraction.h index 43ad7df..df82db9 100644 --- a/dali/integration-api/gl-abstraction.h +++ b/dali/integration-api/gl-abstraction.h @@ -2,7 +2,7 @@ #define DALI_INTEGRATION_GL_ABSTRACTION_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,12 +94,17 @@ namespace Integration class GlAbstraction { protected: - /** - * Virtual protected destructor, no deletion through this interface - */ - virtual ~GlAbstraction() = default; + // Protected construction & deletion + GlAbstraction() = default; ///< Protected constructor so an instance of this class cannot be created. + virtual ~GlAbstraction() = default; ///< Virtual protected destructor, no deletion through this interface. public: + // Not copyable but movable + GlAbstraction(const GlAbstraction&) = delete; ///< Deleted copy constructor. + GlAbstraction(GlAbstraction&&) = default; ///< Default move constructor. + GlAbstraction& operator=(const GlAbstraction&) = delete; ///< Deleted copy assignment operator. + GlAbstraction& operator=(GlAbstraction&&) = default; ///< Default move assignment operator. + /** * Invoked by Render thread before Core::Render. */ -- 2.7.4