mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-12 05:27:07 +00:00
Fix deadlock when obtaining the font ID
This commit is contained in:
parent
91582257fb
commit
77e67c19fe
1 changed files with 3 additions and 1 deletions
|
@ -50,7 +50,9 @@ impl TextSystem {
|
|||
}
|
||||
|
||||
pub fn font_id(&self, font: &Font) -> Result<FontId> {
|
||||
if let Some(font_id) = self.font_ids_by_font.read().get(font).copied() {
|
||||
let font_id = self.font_ids_by_font.read().get(font).copied();
|
||||
|
||||
if let Some(font_id) = font_id {
|
||||
Ok(font_id)
|
||||
} else {
|
||||
let font_id = self.platform_text_system.font_id(font)?;
|
||||
|
|
Loading…
Reference in a new issue