Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various crashes, leaks, and cycles #468

Closed
wants to merge 6 commits into from

Remove unnecessary cycle between FontEntry and FontFamily.

  • Loading branch information
jdm committed May 22, 2013
commit 818d29d13a7e5ca18cc4515c0dee6a598a433949
@@ -132,7 +132,6 @@ impl FontFamily {
/// In the common case, each FontFamily will have a singleton FontEntry, or it will have the
/// standard four faces: Normal, Bold, Italic, BoldItalic.
pub struct FontEntry {
family: @mut FontFamily,
face_name: ~str,
priv weight: CSSFontWeight,
priv italic: bool,
@@ -141,9 +140,8 @@ pub struct FontEntry {
}

impl FontEntry {
pub fn new(family: @mut FontFamily, handle: FontHandle) -> FontEntry {
pub fn new(handle: FontHandle) -> FontEntry {
FontEntry {
family: family,
face_name: handle.face_name(),
weight: handle.boldness(),
italic: handle.is_italic(),
@@ -116,7 +116,7 @@ pub impl FontListHandle {
let font_handle = font_handle.unwrap();

debug!("Creating new FontEntry for face: %s", font_handle.face_name());
let entry = @FontEntry::new(family, font_handle);
let entry = @FontEntry::new(font_handle);
family.entries.push(entry);
}

@@ -51,7 +51,7 @@ pub impl FontListHandle {
let handle = result::unwrap(FontHandle::new_from_CTFont(&self.fctx, font));

debug!("Creating new FontEntry for face: %s", handle.face_name());
let entry = @FontEntry::new(family, handle);
let entry = @FontEntry::new(handle);
family.entries.push(entry)
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.