diff options
author | Denis Steckelmacher <steckdenis@yahoo.fr> | 2011-07-23 16:55:42 +0200 |
---|---|---|
committer | Denis Steckelmacher <steckdenis@yahoo.fr> | 2011-07-23 16:55:42 +0200 |
commit | 271a00fe91f06921ac7d04ecbf30dfc268e36669 (patch) | |
tree | 85076a731eec0617bcbdccd7a6e6de414f2f4986 /tests | |
parent | d3d1871cb7246c07f700b55a73283cbcb7b9ba59 (diff) |
Fix some memory leaks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_commandqueue.cpp | 1 | ||||
-rw-r--r-- | tests/test_context.cpp | 7 | ||||
-rw-r--r-- | tests/test_mem.cpp | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_commandqueue.cpp b/tests/test_commandqueue.cpp index aea146e..589430b 100644 --- a/tests/test_commandqueue.cpp +++ b/tests/test_commandqueue.cpp @@ -336,6 +336,7 @@ START_TEST (test_events) clReleaseEvent(write_event); clReleaseEvent(user_event); + clReleaseMemObject(buf); clReleaseCommandQueue(queue); clReleaseContext(ctx); } diff --git a/tests/test_context.cpp b/tests/test_context.cpp index 22ae725..4273a8a 100644 --- a/tests/test_context.cpp +++ b/tests/test_context.cpp @@ -84,6 +84,8 @@ START_TEST (test_create_context) ctx == 0, "errcode_ret can be NULL" ); + + clReleaseContext(ctx); } END_TEST @@ -97,6 +99,8 @@ START_TEST (test_create_context_from_type) result != CL_SUCCESS || ctx == 0, "unable to create a valid context with a device of type default" ); + + clReleaseContext(ctx); } END_TEST @@ -208,6 +212,9 @@ START_TEST (test_get_context_info) context_info.properties.prop_platform != CL_CONTEXT_PLATFORM, "this context must have a valid CL_CONTEXT_PLATFORM property" ); + + clReleaseContext(ctx); + clReleaseContext(ctx); } END_TEST diff --git a/tests/test_mem.cpp b/tests/test_mem.cpp index fee9a2b..b1fd477 100644 --- a/tests/test_mem.cpp +++ b/tests/test_mem.cpp @@ -138,7 +138,7 @@ START_TEST (test_create_sub_buffer) "cannot create a valid sub-buffer" ); - subbuf = clCreateSubBuffer(subbuf, CL_MEM_WRITE_ONLY, + clCreateSubBuffer(subbuf, CL_MEM_WRITE_ONLY, CL_BUFFER_CREATE_TYPE_REGION, (void *)&create_info, &result); fail_if( @@ -240,6 +240,7 @@ START_TEST (test_read_write_subbuf) "the buffer must contain \"Hello, world !\"" ); + clReleaseCommandQueue(queue); clReleaseMemObject(subbuf); clReleaseMemObject(buf); clReleaseContext(ctx); |