Skip to content

Commit b605f01

Browse files
committed
set zeModule nullptr to avoid double destroy
Signed-off-by: Byoungro So <[email protected]>
1 parent 9a6b91d commit b605f01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4308,7 +4308,9 @@ pi_result piProgramBuild(pi_program Program, pi_uint32 NumDevices,
43084308
if (ZeResult != ZE_RESULT_SUCCESS) {
43094309
// remove ZeModule that is associated with the failed program
43104310
ZE_CALL_NOCHECK(zeModuleDestroy, (ZeModule));
4311-
4311+
// Also set Program->ZeModule nullptr to avoid double destroy of zeModule in
4312+
// case where SYCL RT calls piProgramRelease().
4313+
Program->ZeModule = nullptr;
43124314
if (ZeResult == ZE_RESULT_ERROR_MODULE_LINK_FAILURE)
43134315
return PI_BUILD_PROGRAM_FAILURE;
43144316
return mapError(ZeResult);

0 commit comments

Comments
 (0)