Fix memory leak

getLastQueuedCommand(true) will implictly retain the last command, hence if we're not putting it in the waitlist, we should release it.

Change-Id: I1ad4ddcdf1df5237b83e1ea2447eb39a59f7dc3a
Este commit está contenido en:
Vladislav Sytchenko
2020-08-26 12:44:01 -04:00
cometido por Vladislav Sytchenko
padre 1c966637a4
commit 61b84e246c
+7 -4
Ver fichero
@@ -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();
}
}
}
}