summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-02-04 00:12:17 +0000
committerKarl Heuer <kwzh@gnu.org>1995-02-04 00:12:17 +0000
commit3980306f4c41c1beec7642a18b35f56b11826390 (patch)
tree257e4d389afb3dcab1642172bff22f919249610c /src
parent7ac74fa4cf271fd8da26a2f04b01c7075ce1b0e7 (diff)
downloademacs-3980306f4c41c1beec7642a18b35f56b11826390.tar.gz
[MULTI_PERDISPLAY] (x_term_init): Initialize perdisplay.
[MULTI_PERDISPLAY] (x_delete_display): Destroy perdisplay. (x_delete_display): Use xfree, not free.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 4a95688270b..62e7072dc4b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5580,6 +5580,12 @@ x_term_init (display_name, xrm_option, resource_name)
dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info));
+#ifdef MULTI_PERDISPLAY
+ init_perdisplay (&dpyinfo->perdisplay);
+ dpyinfo->perdisplay.next_perdisplay = all_perdisplays;
+ all_perdisplays = &dpyinfo->perdisplay;
+#endif
+
/* Put this display on the chain. */
dpyinfo->next = x_display_list;
x_display_list = dpyinfo;
@@ -5755,9 +5761,20 @@ x_delete_display (dpyinfo)
/* I'm told Xt does this itself. */
XrmDestroyDatabase (dpyinfo->xrdb);
#endif
- free (dpyinfo->font_table);
- free (dpyinfo->x_id_name);
- free (dpyinfo);
+#ifdef MULTI_PERDISPLAY
+ {
+ PERDISPLAY **perdp;
+ for (perdp = &all_perdisplays; *perdp != &dpyinfo->perdisplay;
+ perdp = &(*perdp)->next_perdisplay)
+ if (*perdp == NULL)
+ abort ();
+ *perdp = dpyinfo->perdisplay.next_perdisplay;
+ }
+ wipe_perdisplay (&dpyinfo->perdisplay);
+#endif
+ xfree (dpyinfo->font_table);
+ xfree (dpyinfo->x_id_name);
+ xfree (dpyinfo);
}
/* Set up use of X before we make the first connection. */