mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
sceFontWritingInit took a reference on the string's host character storage and kept it in the caller's SceFontWriting bytes. Only a later sceFontWritingInit on the same, unchanged bytes dropped it, so every string drawn with a fresh, zeroed or overwritten writing leaked its characters, and re-initialising both copies of a copied writing dropped its one reference twice. A SceFontWriting has no teardown export, so it is plain caller memory and cannot own anything. sceFontCreateString now allocates the characters through the string's FontMemory, as it already did the string, so no character pointer the guest receives points into host memory. sceFontDestroyString clears the string's magic and frees both, and a failed create clears it before freeing the string. A writing keeps only a pointer to its string and checks the magic on every step, so after the destroy its steps return null unless that memory holds the magic again, as when a new string is allocated there. An init that fails after resetting the writing still leaves it stepping nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>