Fix memory leak when there's no display (#3972)

This commit is contained in:
Mike 2024-05-26 14:42:44 +03:00 committed by GitHub
parent 34553c9714
commit aa33ad1d58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,7 +360,7 @@ class Screen : public concurrency::OSThread
bool enqueueCmd(const ScreenCmd &cmd) bool enqueueCmd(const ScreenCmd &cmd)
{ {
if (!useDisplay) if (!useDisplay)
return true; // claim success if our display is not in use return false; // not enqueued if our display is not in use
else { else {
bool success = cmdQueue.enqueue(cmd, 0); bool success = cmdQueue.enqueue(cmd, 0);
enabled = true; // handle ASAP (we are the registered reader for cmdQueue, but might have been disabled) enabled = true; // handle ASAP (we are the registered reader for cmdQueue, but might have been disabled)