Skip to content

Commit 9f113b3

Browse files
committed
Check that the loader has the symbol before attempting the register callback
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 97f544b commit 9f113b3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

source/lib/ze_lib.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,9 @@ namespace ze_lib
377377
uint32_t*);
378378
auto pfnZelRegisterTeardownCallback = reinterpret_cast<zelRegisterTeardownCallback_t>(
379379
GET_FUNCTION_PTR(loader, "zelRegisterTeardownCallback"));
380-
pfnZelRegisterTeardownCallback(staticLoaderTeardownCallback, &loaderTeardownCallback, &loaderTeardownCallbackIndex);
380+
if (pfnZelRegisterTeardownCallback != nullptr) {
381+
pfnZelRegisterTeardownCallback(staticLoaderTeardownCallback, &loaderTeardownCallback, &loaderTeardownCallbackIndex);
382+
}
381383
});
382384
#endif
383385
return result;

0 commit comments

Comments
 (0)