summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2018-04-26 21:10:17 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2018-04-26 21:10:17 +0200
commit7b416c8686f7cc83c79c886e24851db33baacf80 (patch)
treea2a44984d0329e7a75c2d70654c5a02a0f1e0ea0 /src
parent5d46a3193e9034ba567950f166f4ab2de326fee0 (diff)
Fixed an access violation when compiled with Visual Studio upon releasing the OpenCL program
Diffstat (limited to 'src')
-rw-r--r--src/clpp11.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/clpp11.hpp b/src/clpp11.hpp
index 2119f26b..c4b721b9 100644
--- a/src/clpp11.hpp
+++ b/src/clpp11.hpp
@@ -442,7 +442,9 @@ class Program {
// Source-based constructor with memory management
explicit Program(const Context &context, const std::string &source):
program_(new cl_program, [](cl_program* p) {
- if (*p) { CheckErrorDtor(clReleaseProgram(*p)); }
+ #ifndef _MSC_VER // 'clReleaseProgram' caused an access violation with Visual Studio
+ if (*p) { CheckErrorDtor(clReleaseProgram(*p)); }
+ #endif
delete p;
}) {
const char *source_ptr = &source[0];