作図ソフト dia の改良版
Revision | abd2ecc3aec25265b4fdee5809dffd30027ade33 (tree) |
---|---|
Time | 2004-08-02 03:14:52 |
Author | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Two fixes, and a new prerelease
@@ -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 | + | |
1 | 21 | 2004-07-25 Lars Clausen <lars@raeder.dk> |
2 | 22 | |
3 | 23 | * dia.spec (Release): |
@@ -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 | + | |
1 | 6 | dia-0.94-pre3: 25-Jul-2004 |
2 | 7 | |
3 | 8 | Fixing a number of png issues and a few bugs. |
@@ -290,7 +290,7 @@ handle_initial_diagram(const char *in_file_name, | ||
290 | 290 | |
291 | 291 | if (export_file_format) { |
292 | 292 | char *export_file_name = NULL; |
293 | - DiaExportFilter *ef; | |
293 | + DiaExportFilter *ef = NULL; | |
294 | 294 | |
295 | 295 | /* First try guessing based on extension */ |
296 | 296 | export_file_name = build_output_file_name(in_file_name, |
@@ -17,7 +17,7 @@ | ||
17 | 17 | #define GETTEXT_PACKAGE "dia" |
18 | 18 | #define LOCALEDIR "../lib/locale" |
19 | 19 | |
20 | -#define VERSION "0.94-pre3" | |
20 | +#define VERSION "0.94-pre4" | |
21 | 21 | |
22 | 22 | /* |
23 | 23 | * We are linking libxml as DLL with either msvc or mingw, but this |
@@ -1,6 +1,6 @@ | ||
1 | 1 | dnl Process this -*- autoconf -*- file with autoconf to produce a |
2 | 2 | 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) | |
4 | 4 | AC_CONFIG_SRCDIR(app/diagram.c) |
5 | 5 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION) |
6 | 6 |
@@ -6,7 +6,7 @@ Summary: A gtk+ based diagram creation program. | ||
6 | 6 | Name: %name |
7 | 7 | Version: %ver |
8 | 8 | # This indicates changes to the spec file after last time %ver has changed. |
9 | -Release: pre3 | |
9 | +Release: pre4 | |
10 | 10 | Copyright: GPL |
11 | 11 | Group: Applications/ |
12 | 12 | Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/dia/%{name}-%{ver}.tar.gz |
@@ -8,7 +8,7 @@ | ||
8 | 8 | |
9 | 9 | [ |
10 | 10 | |
11 | - <!ENTITY VERSION "0.94-pre3"> | |
11 | + <!ENTITY VERSION "0.94-pre4"> | |
12 | 12 | |
13 | 13 | <!ENTITY INTRODUCTION SYSTEM "intro.xml"> |
14 | 14 |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
2 | 2 | |
3 | 3 | <!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"> | |
5 | 5 | <!ENTITY INTRODUCTION SYSTEM "intro.sgml"> |
6 | 6 | <!ENTITY QUICKSTART SYSTEM "usage-quickstart.sgml"> |
7 | 7 | <!ENTITY CANVAS SYSTEM "usage-canvas.sgml"> |
@@ -524,7 +524,7 @@ layout_cache_equals(gconstpointer e1, gconstpointer e2) | ||
524 | 524 | |
525 | 525 | return strcmp(i1->string, i2->string) == 0 && |
526 | 526 | fabs(i1->height - i2->height) < 0.00001 && |
527 | - i1->font == i2->font; | |
527 | + pango_font_description_equal(i1->font->pfd, i2->font->pfd); | |
528 | 528 | } |
529 | 529 | |
530 | 530 | static guint |
@@ -534,7 +534,7 @@ layout_cache_hash(gconstpointer el) | ||
534 | 534 | |
535 | 535 | return g_str_hash(item->string) ^ |
536 | 536 | (int)(item->height*1000) ^ |
537 | - (int)(item->font); | |
537 | + (int)(item->font->pfd); | |
538 | 538 | } |
539 | 539 | |
540 | 540 | static long layout_cache_last_use; |
@@ -556,7 +556,6 @@ layout_cache_cleanup_idle(gpointer data) | ||
556 | 556 | GHashTable *table = (GHashTable*)(data); |
557 | 557 | |
558 | 558 | g_hash_table_foreach_remove(table, layout_cache_cleanup_entry, NULL); |
559 | - | |
560 | 559 | return FALSE; |
561 | 560 | } |
562 | 561 |
@@ -567,7 +566,7 @@ static gboolean | ||
567 | 566 | layout_cache_cleanup(gpointer data) |
568 | 567 | { |
569 | 568 | /* 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) { | |
571 | 570 | /* Don't go directly to cleanup, wait till there's a pause. */ |
572 | 571 | g_idle_add(layout_cache_cleanup_idle, data); |
573 | 572 | } |
@@ -586,7 +585,7 @@ layout_cache_free_key(gpointer data) | ||
586 | 585 | } |
587 | 586 | |
588 | 587 | if (item->font != NULL) { |
589 | - g_object_unref(item->font); | |
588 | + dia_font_unref(item->font); | |
590 | 589 | item->font = NULL; |
591 | 590 | } |
592 | 591 |
@@ -616,7 +615,13 @@ dia_font_build_layout(const char* string, DiaFont* font, real height) | ||
616 | 615 | layout_cache_equals, |
617 | 616 | layout_cache_free_key, |
618 | 617 | 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); | |
620 | 625 | } else { |
621 | 626 | LayoutCacheItem item; |
622 | 627 | item.string = string; |
@@ -633,7 +638,7 @@ dia_font_build_layout(const char* string, DiaFont* font, real height) | ||
633 | 638 | cached = g_new0(LayoutCacheItem,1); |
634 | 639 | cached->string = g_strdup(string); |
635 | 640 | cached->font = font; |
636 | - g_object_ref(font); | |
641 | + dia_font_ref(font); | |
637 | 642 | cached->height = height; |
638 | 643 | |
639 | 644 | height *= 0.7; |
@@ -673,7 +678,7 @@ dia_font_build_layout(const char* string, DiaFont* font, real height) | ||
673 | 678 | cached->layout = layout; |
674 | 679 | g_object_ref(layout); |
675 | 680 | cached->usecount = 1; |
676 | - g_hash_table_insert(layoutcache, cached, cached); | |
681 | + g_hash_table_replace(layoutcache, cached, cached); | |
677 | 682 | |
678 | 683 | return layout; |
679 | 684 | } |