diff --git a/projects/clr/hipamd/rocclr/hip_stream.cpp b/projects/clr/hipamd/rocclr/hip_stream.cpp index 379954ef5c..565bb6d427 100755 --- a/projects/clr/hipamd/rocclr/hip_stream.cpp +++ b/projects/clr/hipamd/rocclr/hip_stream.cpp @@ -159,10 +159,13 @@ void iHipWaitActiveStreams(amd::HostQueue* blocking_queue, bool wait_null_stream (stream->Null() == wait_null_stream)) { // Get the last valid command amd::Command* command = active_queue->getLastQueuedCommand(true); - if ((command != nullptr) && - // Check the current active status - (command->status() != CL_COMPLETE)) { - eventWaitList.push_back(command); + if (command != nullptr) { + // Check the current active status + if (command->status() != CL_COMPLETE) { + eventWaitList.push_back(command); + } else { + command->release(); + } } } }