[teklib-general] changeset in /hg/teklib/current: Sources and all targets correct...
Timm S. Mueller
tmueller at neoscientists.org
Mon Nov 26 16:23:24 CET 2007
changeset 78721a2f595e in /hg/teklib/current
details: http://teklib.org:8001/hg/teklib/current?cmd=changeset;node=78721a2f595e
description:
Sources and all targets corrected, memory leak fixed
diffs (109 lines):
diff -r 11c0320856f0 -r 78721a2f595e src/visual/build/tmkmakefile
--- a/src/visual/build/tmkmakefile Tue Sep 11 19:09:44 2007 +0200
+++ b/src/visual/build/tmkmakefile Sun Sep 16 15:08:29 2007 +0200
@@ -127,6 +127,7 @@
[embed body="sources"]
visual_mod.c
visual_mod.h
+ visual_host.h
[/embed]
[embed body="sourcedep"]
$(SRCDIR)/visual_mod.c
@@ -136,6 +137,10 @@
$(SRCDIR)/visual_mod.h
visual_mod.h
[/embed]
+ [embed body="sourcedep"]
+ $(SRCDIR)/visual_host.h
+ $(PLATFORM)/visual_host.h
+ [/embed]
[/body]
[include name="BUILD:builds.tmk"/]
diff -r 11c0320856f0 -r 78721a2f595e src/visual/posix/visual_host.c
--- a/src/visual/posix/visual_host.c Tue Sep 11 19:09:44 2007 +0200
+++ b/src/visual/posix/visual_host.c Sun Sep 16 15:08:29 2007 +0200
@@ -1009,22 +1009,21 @@ vis_init(TMOD_VIS *mod)
TAPTR exec = TGetExecBase(mod);
GLOBAL *g = TExecAlloc0(exec, mod->vis_MMU, sizeof(GLOBAL));
if (g == TNULL) return TFALSE;
+ mod->vis_HostGlobal = g;
for (;;)
{
TTAGITEM ftags[3];
TInitList(&g->vlist);
+ /* init fontmanager and default font */
+ TInitList(&g->fm.openfonts);
+
g->lock = TExecCreateLock(exec, TNULL);
if (g->lock == TNULL) break;
g->display = XOpenDisplay(TNULL);
if (g->display == TNULL) break;
-
- mod->vis_HostGlobal = g;
-
- /* init fontmanager and default font */
- TInitList(&g->fm.openfonts);
ftags[0].tti_Tag = TVisual_FontName;
ftags[0].tti_Value = (TTAG) FNT_DEFNAME;
@@ -1047,24 +1046,28 @@ vis_exit(TMOD_VIS *mod)
{
TAPTR exec = TGetExecBase(mod);
GLOBAL *g = mod->vis_HostGlobal;
- struct TNode *node, *next;
-
- /* force closing of default font */
- g->fm.defref = 0;
-
- /* close all fonts */
- node = g->fm.openfonts.tlh_Head;
- for (; (next = node->tln_Succ); node = next)
- {
- vis_hostclosefont(mod, (TAPTR)node);
- }
-
- if (g->display)
- XCloseDisplay(g->display);
-
- TDestroy(g->lock);
-
- TExecFree(exec, g);
+ if (g)
+ {
+ struct TNode *node, *next;
+
+ /* force closing of default font */
+ g->fm.defref = 0;
+
+ /* close all fonts */
+ node = g->fm.openfonts.tlh_Head;
+ for (; (next = node->tln_Succ); node = next)
+ {
+ vis_hostclosefont(mod, (TAPTR)node);
+ }
+
+ if (g->display)
+ XCloseDisplay(g->display);
+
+ TDestroy(g->lock);
+
+ TExecFree(exec, g);
+ }
+
mod->vis_HostGlobal = TNULL;
}
diff -r 11c0320856f0 -r 78721a2f595e src/visual/visual_all.c
--- a/src/visual/visual_all.c Tue Sep 11 19:09:44 2007 +0200
+++ b/src/visual/visual_all.c Sun Sep 16 15:08:29 2007 +0200
@@ -20,5 +20,6 @@
#if defined(TSYS_POSIX)
#include "posix/visual_host.c"
+#include "posix/visual_font.c"
#endif
More information about the teklib-general
mailing list