File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -833,11 +833,8 @@ urEventRetain(ur_event_handle_t Event ///< [in] handle of the event object
833833ur_result_t
834834urEventRelease (ur_event_handle_t Event // /< [in] handle of the event object
835835) {
836- if (--Event->RefCountExternal == 0 && Event->CounterBasedEventsEnabled ) {
837- Event->Context ->addEventToContextCache (Event);
838- } else {
839- UR_CALL (urEventReleaseInternal (Event));
840- }
836+ Event->RefCountExternal --;
837+ UR_CALL (urEventReleaseInternal (Event));
841838 return UR_RESULT_SUCCESS;
842839}
843840
@@ -1057,7 +1054,8 @@ ur_result_t urEventReleaseInternal(ur_event_handle_t Event) {
10571054 // When we add an event to the cache we need to check whether profiling is
10581055 // enabled or not, so we access properties of the queue and that's why queue
10591056 // must released later.
1060- if (DisableEventsCaching || !Event->OwnNativeHandle ) {
1057+ if ((Event->RefCountExternal > 0 && !Event->CounterBasedEventsEnabled ) &&
1058+ (DisableEventsCaching || !Event->OwnNativeHandle )) {
10611059 delete Event;
10621060 } else {
10631061 Event->Context ->addEventToContextCache (Event);
You can’t perform that action at this time.
0 commit comments