summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2002-11-12 04:07:07 +0000
committerTor Lillqvist <tml@src.gnome.org>2002-11-12 04:07:07 +0000
commit4b14c577617509ee04d34e8ec6dd9e759df75be0 (patch)
tree45f4045bff4ed5bb11f213b087cdc3c0f1150155
parent8d352139536682bf58b5a25a42b1f35d5f058ade (diff)
downloadpango-4b14c577617509ee04d34e8ec6dd9e759df75be0.tar.gz
Add more debugging output.
2002-11-12 Tor Lillqvist <tml@iki.fi> * pango/pangowin32-fontcache.c (free_cache_entry, cache_entry_unref, pango_win32_font_cache_load): Add more debugging output. * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak: Free return value from pango_win32_font_logfont(). Call pango_win32_font_cache_unload() for the hfont returned from pango_win32_font_cache_load() after using it.
-rw-r--r--ChangeLog11
-rw-r--r--ChangeLog.pre-1-1011
-rw-r--r--ChangeLog.pre-1-211
-rw-r--r--ChangeLog.pre-1-411
-rw-r--r--ChangeLog.pre-1-611
-rw-r--r--ChangeLog.pre-1-811
-rw-r--r--modules/basic/basic-win32.c16
-rw-r--r--pango/pangowin32-fontcache.c8
8 files changed, 86 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index dc08085a..3df3b886 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2002-11-12 Tor Lillqvist <tml@iki.fi>
+
+ * pango/pangowin32-fontcache.c (free_cache_entry,
+ cache_entry_unref, pango_win32_font_cache_load): Add more
+ debugging output.
+
+ * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
+ Free return value from pango_win32_font_logfont(). Call
+ pango_win32_font_cache_unload() for the hfont returned from
+ pango_win32_font_cache_load() after using it.
+
Thu Nov 7 10:08:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/basic-x.c:
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index dc08085a..3df3b886 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,14 @@
+2002-11-12 Tor Lillqvist <tml@iki.fi>
+
+ * pango/pangowin32-fontcache.c (free_cache_entry,
+ cache_entry_unref, pango_win32_font_cache_load): Add more
+ debugging output.
+
+ * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
+ Free return value from pango_win32_font_logfont(). Call
+ pango_win32_font_cache_unload() for the hfont returned from
+ pango_win32_font_cache_load() after using it.
+
Thu Nov 7 10:08:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/basic-x.c:
diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2
index dc08085a..3df3b886 100644
--- a/ChangeLog.pre-1-2
+++ b/ChangeLog.pre-1-2
@@ -1,3 +1,14 @@
+2002-11-12 Tor Lillqvist <tml@iki.fi>
+
+ * pango/pangowin32-fontcache.c (free_cache_entry,
+ cache_entry_unref, pango_win32_font_cache_load): Add more
+ debugging output.
+
+ * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
+ Free return value from pango_win32_font_logfont(). Call
+ pango_win32_font_cache_unload() for the hfont returned from
+ pango_win32_font_cache_load() after using it.
+
Thu Nov 7 10:08:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/basic-x.c:
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index dc08085a..3df3b886 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,14 @@
+2002-11-12 Tor Lillqvist <tml@iki.fi>
+
+ * pango/pangowin32-fontcache.c (free_cache_entry,
+ cache_entry_unref, pango_win32_font_cache_load): Add more
+ debugging output.
+
+ * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
+ Free return value from pango_win32_font_logfont(). Call
+ pango_win32_font_cache_unload() for the hfont returned from
+ pango_win32_font_cache_load() after using it.
+
Thu Nov 7 10:08:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/basic-x.c:
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index dc08085a..3df3b886 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,14 @@
+2002-11-12 Tor Lillqvist <tml@iki.fi>
+
+ * pango/pangowin32-fontcache.c (free_cache_entry,
+ cache_entry_unref, pango_win32_font_cache_load): Add more
+ debugging output.
+
+ * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
+ Free return value from pango_win32_font_logfont(). Call
+ pango_win32_font_cache_unload() for the hfont returned from
+ pango_win32_font_cache_load() after using it.
+
Thu Nov 7 10:08:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/basic-x.c:
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index dc08085a..3df3b886 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,14 @@
+2002-11-12 Tor Lillqvist <tml@iki.fi>
+
+ * pango/pangowin32-fontcache.c (free_cache_entry,
+ cache_entry_unref, pango_win32_font_cache_load): Add more
+ debugging output.
+
+ * modules/basic/basic-win32.c (uniscribe_shape): Plug memory leak:
+ Free return value from pango_win32_font_logfont(). Call
+ pango_win32_font_cache_unload() for the hfont returned from
+ pango_win32_font_cache_load() after using it.
+
Thu Nov 7 10:08:19 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
* modules/basic/basic-x.c:
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index f2dedd98..1b5cf8b2 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -835,7 +835,8 @@ uniscribe_shape (PangoFont *font,
int wlen, i;
gboolean retval = TRUE;
GError *error;
- HGDIOBJ old_font;
+ HGDIOBJ old_font = NULL;
+ HFONT hfont = NULL;
LOGFONT *lf;
SCRIPT_CACHE script_cache[100];
@@ -847,7 +848,15 @@ uniscribe_shape (PangoFont *font,
wlen /= 2;
lf = pango_win32_font_logfont (font);
- old_font = SelectObject (hdc, pango_win32_font_cache_load (font_cache, lf));
+ hfont = pango_win32_font_cache_load (font_cache, lf);
+ g_free (lf);
+
+ if (hfont == NULL)
+ retval = FALSE;
+
+ if (retval)
+ old_font = SelectObject (hdc, hfont);
+
if (old_font == NULL)
{
#ifdef BASIC_WIN32_DEBUGGING
@@ -887,6 +896,9 @@ uniscribe_shape (PangoFont *font,
if (old_font != NULL)
SelectObject (hdc, old_font);
+ if (hfont != NULL)
+ pango_win32_font_cache_unload (font_cache, hfont);
+
return retval;
}
diff --git a/pango/pangowin32-fontcache.c b/pango/pangowin32-fontcache.c
index 9d8db725..8b07f492 100644
--- a/pango/pangowin32-fontcache.c
+++ b/pango/pangowin32-fontcache.c
@@ -57,7 +57,8 @@ free_cache_entry (LOGFONT *logfont,
CacheEntry *entry,
PangoWin32FontCache *cache)
{
- DeleteObject (entry->hfont);
+ if (!DeleteObject (entry->hfont))
+ PING (("DeleteObject for hfont %p failed", entry->hfont));
g_free (entry);
}
@@ -144,6 +145,8 @@ cache_entry_unref (PangoWin32FontCache *cache,
entry->ref_count--;
if (entry->ref_count == 0)
{
+ PING (("removing cache entry %p", entry->hfont));
+
g_hash_table_remove (cache->forward, &entry->logfont);
g_hash_table_remove (cache->back, entry->hfont);
@@ -181,6 +184,7 @@ pango_win32_font_cache_load (PangoWin32FontCache *cache,
if (entry)
{
entry->ref_count++;
+ PING (("increased refcount for cache entry %p: %d", entry->hfont, entry->ref_count));
}
else
{
@@ -233,7 +237,7 @@ pango_win32_font_cache_load (PangoWin32FontCache *cache,
if (hfont != NULL)
{
- PING (("Success!"));
+ PING (("Success! hfont=%p", hfont));
break;
}