summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbuliabyak <>2013-09-28 20:24:31 +0000
committerbuliabyak <>2013-09-28 20:24:31 +0000
commitc83329cdf1c37fd1ee123a0f30e8b6582ac51547 (patch)
treea12540df7ce6a64ef7cb3d4290f4828e1137205b /src
parentfix two memleaks (diff)
downloadinkscape-c83329cdf1c37fd1ee123a0f30e8b6582ac51547.tar.gz
inkscape-c83329cdf1c37fd1ee123a0f30e8b6582ac51547.zip
prevent redundant firing of InitTheFace (pFont never changes, but init is called all over the place); also some nulling and freeing to prevent leaks, and removing the redundant daddy unreffing that is done in ~FontInstance anyway
(bzr r12618)
Diffstat (limited to 'src')
-rw-r--r--src/libnrtype/FontInstance.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp
index fd0cdd3d4..38a105459 100644
--- a/src/libnrtype/FontInstance.cpp
+++ b/src/libnrtype/FontInstance.cpp
@@ -192,6 +192,7 @@ font_instance::~font_instance(void)
//printf("font instance death\n");
if ( pFont ) {
+ FreeTheFace();
g_object_unref(pFont);
pFont = 0;
}
@@ -232,10 +233,6 @@ void font_instance::Unref(void)
//printf("font %x %s unref'd %i\n",this,tc,refCount);
//free(tc);
if ( refCount <= 0 ) {
- if ( daddy ) {
- daddy->UnrefFace(this);
- }
- daddy=NULL;
delete this;
}
}
@@ -387,6 +384,7 @@ unsigned int font_instance::Attribute(const gchar *key, gchar *str, unsigned int
void font_instance::InitTheFace()
{
+ if (theFace == NULL && pFont != NULL) {
#ifdef USE_PANGO_WIN32
if ( !theFace ) {
LOGFONT *lf=pango_win32_font_logfont(pFont);
@@ -404,6 +402,7 @@ void font_instance::InitTheFace()
FT_Select_Charmap(theFace,ft_encoding_unicode) && FT_Select_Charmap(theFace,ft_encoding_symbol);
}
#endif
+ }
}
void font_instance::FreeTheFace()
@@ -423,6 +422,7 @@ void font_instance::InstallFace(PangoFont* iFace)
return;
}
pFont=iFace;
+ iFace = NULL;
InitTheFace();