diff --git a/rocclr/platform/commandqueue.cpp b/rocclr/platform/commandqueue.cpp index daae776bd5..339239b831 100644 --- a/rocclr/platform/commandqueue.cpp +++ b/rocclr/platform/commandqueue.cpp @@ -113,7 +113,11 @@ void HostQueue::finish() { return; } } + if (nullptr == command || !isCacheFlushed) { + if (nullptr != command) { + command->release(); + } // Send a finish to make sure we finished all commands command = new Marker(*this, false); if (command == NULL) {