From 62889f3fa68127b1e066d6382bdb03d4b73c61de Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 3 May 2010 03:21:22 +0000 Subject: [PATCH] fix release_font issue --- panda/src/text/fontPool.cxx | 9 +++++++-- panda/src/text/fontPool.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) 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;