diff --git a/panda/src/text/fontPool.cxx b/panda/src/text/fontPool.cxx index 301c31840d..8c56c90983 100644 --- a/panda/src/text/fontPool.cxx +++ b/panda/src/text/fontPool.cxx @@ -166,11 +166,16 @@ ns_add_font(const string &str, TextFont *font) { // Description: The nonstatic implementation of release_font(). //////////////////////////////////////////////////////////////////// void FontPool:: -ns_release_font(const string &filename) { +ns_release_font(const string &str) { LightMutexHolder holder(_lock); + string index_str; + Filename filename; + int face_index; + lookup_filename(str, index_str, filename, face_index); + Fonts::iterator ti; - ti = _fonts.find(filename); + ti = _fonts.find(index_str); if (ti != _fonts.end()) { _fonts.erase(ti); } diff --git a/panda/src/text/fontPool.h b/panda/src/text/fontPool.h index f02b895c91..0895d0fe37 100644 --- a/panda/src/text/fontPool.h +++ b/panda/src/text/fontPool.h @@ -54,7 +54,7 @@ private: bool ns_has_font(const string &str); TextFont *ns_load_font(const string &str); void ns_add_font(const string &str, TextFont *font); - void ns_release_font(const string &filename); + void ns_release_font(const string &str); void ns_release_all_fonts(); int ns_garbage_collect(); void ns_list_contents(ostream &out) const;