emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash: XSetWMIconName, x_set_name_internal, prepare_menu_bars


From: YAMAMOTO Mitsuharu
Subject: Re: Crash: XSetWMIconName, x_set_name_internal, prepare_menu_bars
Date: Fri, 01 Jun 2007 12:27:30 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shij┼Ź) APEL/10.6 Emacs/22.0.990 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Fri, 01 Jun 2007 10:05:41 +0900, YAMAMOTO Mitsuharu <address@hidden> 
>>>>> said:

> I think this is due to string data relocation caused by ENCODE_UTF_8
> in x_set_name_internal (GTK+ only).

GCPRO was missing in the previous patch.  Below is a revised one.

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/xfns.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfns.c,v
retrieving revision 1.681
diff -c -p -r1.681 xfns.c
*** src/xfns.c  24 Mar 2007 15:40:38 -0000      1.681
--- src/xfns.c  1 Jun 2007 03:24:43 -0000
*************** x_set_name_internal (f, name)
*** 1605,1610 ****
--- 1605,1620 ----
        int bytes, stringp;
          int do_free_icon_value = 0, do_free_text_value = 0;
        Lisp_Object coding_system;
+ #ifdef USE_GTK
+       Lisp_Object encoded_name;
+       struct gcpro gcpro1;
+ 
+       /* As ENCODE_UTF_8 may cause GC and relocation of string data,
+          we use it before x_encode_text that may return string data.  */
+       GCPRO1 (name);
+       encoded_name = ENCODE_UTF_8 (name);
+       UNGCPRO;
+ #endif
  
        coding_system = Qcompound_text;
        /* Note: Encoding strategy
*************** x_set_name_internal (f, name)
*** 1645,1651 ****
  
  #ifdef USE_GTK
          gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
!                               (char *) SDATA (ENCODE_UTF_8 (name)));
  #else /* not USE_GTK */
        XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
  #endif /* not USE_GTK */
--- 1655,1661 ----
  
  #ifdef USE_GTK
          gtk_window_set_title (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
!                               (char *) SDATA (encoded_name));
  #else /* not USE_GTK */
        XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
  #endif /* not USE_GTK */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]