aboutsummaryrefslogtreecommitdiff
path: root/src/api/api_enqueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/api_enqueue.cpp')
-rw-r--r--src/api/api_enqueue.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/api/api_enqueue.cpp b/src/api/api_enqueue.cpp
index 759ed92..7fce1d9 100644
--- a/src/api/api_enqueue.cpp
+++ b/src/api/api_enqueue.cpp
@@ -103,7 +103,7 @@ static inline cl_int queueEvent(Coal::CommandQueue *queue,
delete command;
return rs;
}
- command->dereference();
+ clReleaseEvent(d_event);
}
return CL_SUCCESS;
@@ -599,7 +599,7 @@ clEnqueueMapBuffer(cl_command_queue d_command_queue,
if (*errcode_ret != CL_SUCCESS)
{
- delete command;
+ // delete command; // command already deleted in queueEvent()
return 0;
}
else
@@ -667,7 +667,7 @@ clEnqueueMapImage(cl_command_queue d_command_queue,
if (*errcode_ret != CL_SUCCESS)
{
- delete command;
+ // delete command; // command already deleted in queueEvent()
return 0;
}
else
@@ -912,13 +912,12 @@ clEnqueueMarkerWithWaitList(cl_command_queue d_command_queue,
}
if (!event_wait_list) {
- // Free events, they were memcpyed by CommandQueue::events()
- for (unsigned int i=0; i<count; ++i)
- {
+ // Free events, they were memcpyed by CommandQueue::events()
+ for (unsigned int i=0; i<count; ++i) {
events[i]->dereference();
}
- if (events != NULL) std::free(events);
- if (e_wait_list != NULL) std::free(e_wait_list);
+ if (events != NULL) std::free(events);
+ if (e_wait_list != NULL) std::free(e_wait_list);
}
return queueEvent(command_queue, command, event, false);