diff options
author | Sergey Sharybin <sergey@blender.org> | 2021-05-03 16:07:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-05-03 16:07:14 +0300 |
commit | 1b4f0bf32aa5215325ca33f81898a7eeef9da2f8 (patch) | |
tree | 19c444c5c3a0759f44132b9576137cd87080f435 /source/blender/compositor/intern/COM_Device.h | |
parent | 6899dbef77cd26df3588888040887e4e41c1ec43 (diff) |
Fix T87989: Crash using OpenCL in compositor
Initial report was mentioning the Classroom demo scene, but this is
probably because the scene was pre-configured to be used with OpenCL.
Would expect any OpenCL compositing to be failing prior to this fix.
The reason why crash was happening is due to OpenCL queue being
released from OpenCLDevice destructor. Is not that obvious, but
when Vector (including std::vector) is holding elements by value
a destructor will be called on "old" memory when vector capacitance
changes.
Solved by making forbidding copy semantic for compositor devices and
forcing move semantic to be used.
Also use emplace semantic in the devices vector initialization.
Diffstat (limited to 'source/blender/compositor/intern/COM_Device.h')
-rw-r--r-- | source/blender/compositor/intern/COM_Device.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_Device.h b/source/blender/compositor/intern/COM_Device.h index 2a43c1be2b4..c848672a405 100644 --- a/source/blender/compositor/intern/COM_Device.h +++ b/source/blender/compositor/intern/COM_Device.h @@ -30,6 +30,14 @@ namespace blender::compositor { class Device { public: + Device() = default; + + Device(const Device &other) = delete; + Device(Device &&other) noexcept = default; + + Device &operator=(const Device &other) = delete; + Device &operator=(Device &&other) = delete; + /** * \brief Declaration of the virtual destructor * \note resolve warning gcc 4.7 |