]> git.vomp.tv Git - vompclient.git/commit
Bug fix: SurfaceVector/OsdVector: reference counts for style VectorHandles
authorChris Tallon <chris@vomp.tv>
Mon, 11 May 2020 22:54:57 +0000 (23:54 +0100)
committerChris Tallon <chris@vomp.tv>
Mon, 11 May 2020 22:54:57 +0000 (23:54 +0100)
commit7817d2169bfd8f21be326d4963dcadee792d5bab
tree71f665fd28f148db4a1ba9ee49f3a8bb9a25cd15
parenta63505b3f7c21a007ba93a99f6991876c3df292c
Bug fix: SurfaceVector/OsdVector: reference counts for style VectorHandles

SurfaceVector::drawText() would only call getStyleRef(DrawStyle)
once per string drawn. This resulted in a ref count of 1 regardless
of how many chars were drawn. Each time Boxx:draw() was called,
surface->fillblt would call removeCommands which dereferenced 1 for
each character. This eventually results in ref counts of zero or
negative. The GC deletes the DrawStyle/VectorHandle mapping if the
ref count is exactly zero, meaning just sometimes a style is deleted
when it is to be used. When this happens text on screen disappears.

This *might* also be the fix for a Windows client crashing bug.
surfacevector.cc