MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / sth_delete

Function sth_delete

examples/OpenGLWindow/fontstash.cpp:853–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851}
852
853void sth_delete(struct sth_stash* stash)
854{
855 struct sth_texture* tex = NULL;
856 struct sth_texture* curtex = NULL;
857 struct sth_font* fnt = NULL;
858 struct sth_font* curfnt = NULL;
859
860 if (!stash) return;
861
862 tex = stash->textures;
863 while (tex != NULL)
864 {
865 curtex = tex;
866 free(tex->m_texels);
867 tex->m_texels = 0;
868 tex = tex->next;
869 stash->m_renderCallbacks->updateTexture(curtex, 0, 0, 0);
870 free(curtex);
871 }
872
873 fnt = stash->fonts;
874 while (fnt != NULL)
875 {
876 curfnt = fnt;
877 fnt = fnt->next;
878 if (curfnt->glyphs)
879 {
880 free(curfnt->glyphs);
881 }
882 if (curfnt->type == TTFONT_FILE && curfnt->data)
883 {
884 free(curfnt->data);
885 }
886 free(curfnt);
887 }
888 free(stash);
889}

Callers 2

mainFunction · 0.85
~SimpleOpenGL3AppMethod · 0.85

Calls 1

updateTextureMethod · 0.45

Tested by

no test coverage detected