• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revisionabd2ecc3aec25265b4fdee5809dffd30027ade33 (tree)
Time2004-08-02 03:14:52
AuthorLars Clausen <lclausen@src....>
CommiterLars Clausen

Log Message

Two fixes, and a new prerelease

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
1+2004-08-01 Lars Clausen <lars@raeder.dk>
2+
3+ * NEWS:
4+ * configure.in:
5+ * dia.spec (Release):
6+ * config.h.win32:
7+ * doc/pl/dia.xml:
8+ * doc/en/dia.xml: Prerelease 4.
9+
10+ * lib/font.c (dia_font_build_layout): Better comparision and
11+ freeing of font cache.
12+
13+2004-07-31 Lars Clausen <lars@raeder.dk>
14+
15+ * lib/font.c (dia_font_build_layout): Faster update to avoid
16+ memory leaks.
17+
18+ * app/app_procs.c: Fix from Tom Parker <palfrey@bits.bris.ac.uk>:
19+ Correctly initialize export filter variable.
20+
121 2004-07-25 Lars Clausen <lars@raeder.dk>
222
323 * dia.spec (Release):
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
1+dia-0.94-pre4: 1-Aug-2004
2+
3+Important fix for export filters. Still some leaking from layout cache,
4+but not as awful.
5+
16 dia-0.94-pre3: 25-Jul-2004
27
38 Fixing a number of png issues and a few bugs.
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -290,7 +290,7 @@ handle_initial_diagram(const char *in_file_name,
290290
291291 if (export_file_format) {
292292 char *export_file_name = NULL;
293- DiaExportFilter *ef;
293+ DiaExportFilter *ef = NULL;
294294
295295 /* First try guessing based on extension */
296296 export_file_name = build_output_file_name(in_file_name,
--- a/config.h.win32
+++ b/config.h.win32
@@ -17,7 +17,7 @@
1717 #define GETTEXT_PACKAGE "dia"
1818 #define LOCALEDIR "../lib/locale"
1919
20-#define VERSION "0.94-pre3"
20+#define VERSION "0.94-pre4"
2121
2222 /*
2323 * We are linking libxml as DLL with either msvc or mingw, but this
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
11 dnl Process this -*- autoconf -*- file with autoconf to produce a
22 dnl configure script.
3-AC_INIT(dia, 0.94-pre3, http://bugzilla.gnome.org/enter_bug.cgi?product=dia)
3+AC_INIT(dia, 0.94-pre4, http://bugzilla.gnome.org/enter_bug.cgi?product=dia)
44 AC_CONFIG_SRCDIR(app/diagram.c)
55 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
66
--- a/dia.spec
+++ b/dia.spec
@@ -6,7 +6,7 @@ Summary: A gtk+ based diagram creation program.
66 Name: %name
77 Version: %ver
88 # This indicates changes to the spec file after last time %ver has changed.
9-Release: pre3
9+Release: pre4
1010 Copyright: GPL
1111 Group: Applications/
1212 Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/dia/%{name}-%{ver}.tar.gz
--- a/doc/en/dia.xml
+++ b/doc/en/dia.xml
@@ -8,7 +8,7 @@
88
99 [
1010
11- <!ENTITY VERSION "0.94-pre3">
11+ <!ENTITY VERSION "0.94-pre4">
1212
1313 <!ENTITY INTRODUCTION SYSTEM "intro.xml">
1414
--- a/doc/pl/dia.xml
+++ b/doc/pl/dia.xml
@@ -1,7 +1,7 @@
11 <?xml version="1.0" encoding="iso-8859-1"?>
22
33 <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../dtd/docbookx.dtd"[
4-<!ENTITY VERSION "0.94-pre3">
4+<!ENTITY VERSION "0.94-pre4">
55 <!ENTITY INTRODUCTION SYSTEM "intro.sgml">
66 <!ENTITY QUICKSTART SYSTEM "usage-quickstart.sgml">
77 <!ENTITY CANVAS SYSTEM "usage-canvas.sgml">
--- a/lib/font.c
+++ b/lib/font.c
@@ -524,7 +524,7 @@ layout_cache_equals(gconstpointer e1, gconstpointer e2)
524524
525525 return strcmp(i1->string, i2->string) == 0 &&
526526 fabs(i1->height - i2->height) < 0.00001 &&
527- i1->font == i2->font;
527+ pango_font_description_equal(i1->font->pfd, i2->font->pfd);
528528 }
529529
530530 static guint
@@ -534,7 +534,7 @@ layout_cache_hash(gconstpointer el)
534534
535535 return g_str_hash(item->string) ^
536536 (int)(item->height*1000) ^
537- (int)(item->font);
537+ (int)(item->font->pfd);
538538 }
539539
540540 static long layout_cache_last_use;
@@ -556,7 +556,6 @@ layout_cache_cleanup_idle(gpointer data)
556556 GHashTable *table = (GHashTable*)(data);
557557
558558 g_hash_table_foreach_remove(table, layout_cache_cleanup_entry, NULL);
559-
560559 return FALSE;
561560 }
562561
@@ -567,7 +566,7 @@ static gboolean
567566 layout_cache_cleanup(gpointer data)
568567 {
569568 /* Only cleanup if there has been font activity since last cleanup */
570- if (time(0) - layout_cache_last_use < 60*10) {
569+ if (time(0) - layout_cache_last_use < 10) {
571570 /* Don't go directly to cleanup, wait till there's a pause. */
572571 g_idle_add(layout_cache_cleanup_idle, data);
573572 }
@@ -586,7 +585,7 @@ layout_cache_free_key(gpointer data)
586585 }
587586
588587 if (item->font != NULL) {
589- g_object_unref(item->font);
588+ dia_font_unref(item->font);
590589 item->font = NULL;
591590 }
592591
@@ -616,7 +615,13 @@ dia_font_build_layout(const char* string, DiaFont* font, real height)
616615 layout_cache_equals,
617616 layout_cache_free_key,
618617 NULL);
619- g_timeout_add(10*60*1000, layout_cache_cleanup, (gpointer)layoutcache);
618+ /** Check for cache cleanup every 10 seconds. */
619+ /** This frequent a check is really a hack while we figure out the
620+ * exact problems with reffing the fonts.
621+ * Note to self: The equals function should compare pfd's, but
622+ * then DiaFonts are freed too early.
623+ */
624+ g_timeout_add(10*1000, layout_cache_cleanup, (gpointer)layoutcache);
620625 } else {
621626 LayoutCacheItem item;
622627 item.string = string;
@@ -633,7 +638,7 @@ dia_font_build_layout(const char* string, DiaFont* font, real height)
633638 cached = g_new0(LayoutCacheItem,1);
634639 cached->string = g_strdup(string);
635640 cached->font = font;
636- g_object_ref(font);
641+ dia_font_ref(font);
637642 cached->height = height;
638643
639644 height *= 0.7;
@@ -673,7 +678,7 @@ dia_font_build_layout(const char* string, DiaFont* font, real height)
673678 cached->layout = layout;
674679 g_object_ref(layout);
675680 cached->usecount = 1;
676- g_hash_table_insert(layoutcache, cached, cached);
681+ g_hash_table_replace(layoutcache, cached, cached);
677682
678683 return layout;
679684 }