diff --git a/internal/buffered/command.go b/internal/buffered/command.go index 39bc0935b..3edaf63a6 100644 --- a/internal/buffered/command.go +++ b/internal/buffered/command.go @@ -59,6 +59,6 @@ func flushDelayedCommands() bool { for _, c := range delayedCommands { c.f() } - delayedCommands = nil + delayedCommands = delayedCommands[:0] return true } diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 88b0a061c..9df0439fa 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -269,7 +269,7 @@ func (q *commandQueue) Flush() { q.commands = q.commands[nc:] } theGraphicsDriver.End() - q.commands = nil + q.commands = q.commands[:0] q.nvertices = 0 q.nindices = 0 q.tmpNumIndices = 0