aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2013-05-05 17:16:06 +0200
committerJan Djärv2013-05-05 17:16:06 +0200
commite6076b1bce12dfc10f05c39ef5264247b8ebbee7 (patch)
tree7cc1601f70ccabc564801c1345ddfd6f92f7ea3a /src
parent6c54491c95e3bdc1f447cba478b60b711393b406 (diff)
downloademacs-e6076b1bce12dfc10f05c39ef5264247b8ebbee7.tar.gz
emacs-e6076b1bce12dfc10f05c39ef5264247b8ebbee7.zip
* nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
to where it is used, to avoid autorelease issues. Fixes: debbugs:14050
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/nsmenu.m8
2 files changed, 8 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a3e466954cb..03d3a7e20f5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12013-05-05 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
4 to where it is used, to avoid autorelease issues (Bug#14050).
5
12013-05-05 Paul Eggert <eggert@cs.ucla.edu> 62013-05-05 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273). 8 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 648b568d180..baa683941f8 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -119,7 +119,6 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
119 id menu = [NSApp mainMenu]; 119 id menu = [NSApp mainMenu];
120 static EmacsMenu *last_submenu = nil; 120 static EmacsMenu *last_submenu = nil;
121 BOOL needsSet = NO; 121 BOOL needsSet = NO;
122 const char *submenuTitle = [[submenu title] UTF8String];
123 bool owfi; 122 bool owfi;
124 Lisp_Object items; 123 Lisp_Object items;
125 widget_value *wv, *first_wv, *prev_wv = 0; 124 widget_value *wv, *first_wv, *prev_wv = 0;
@@ -239,7 +238,7 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
239 /* FIXME: we'd like to only parse the needed submenu, but this 238 /* FIXME: we'd like to only parse the needed submenu, but this
240 was causing crashes in the _common parsing code.. need to make 239 was causing crashes in the _common parsing code.. need to make
241 sure proper initialization done.. */ 240 sure proper initialization done.. */
242/* if (submenu && strcmp (submenuTitle, SSDATA (string))) 241/* if (submenu && strcmp ([[submenu title] UTF8String], SSDATA (string)))
243 continue; */ 242 continue; */
244 243
245 submenu_start[i] = menu_items_used; 244 submenu_start[i] = menu_items_used;
@@ -259,7 +258,7 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
259 { 258 {
260 /* should have found a menu for this one but didn't */ 259 /* should have found a menu for this one but didn't */
261 fprintf (stderr, "ERROR: did not find lisp menu for submenu '%s'.\n", 260 fprintf (stderr, "ERROR: did not find lisp menu for submenu '%s'.\n",
262 submenuTitle); 261 [[submenu title] UTF8String]);
263 discard_menu_items (); 262 discard_menu_items ();
264 unbind_to (specpdl_count, Qnil); 263 unbind_to (specpdl_count, Qnil);
265 [pool release]; 264 [pool release];
@@ -346,8 +345,6 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
346 string = AREF (items, i + 1); 345 string = AREF (items, i + 1);
347 if (NILP (string)) 346 if (NILP (string))
348 break; 347 break;
349/* if (submenu && strcmp (submenuTitle, SSDATA (string)))
350 continue; */
351 348
352 wv->name = SSDATA (string); 349 wv->name = SSDATA (string);
353 update_submenu_strings (wv->contents); 350 update_submenu_strings (wv->contents);
@@ -358,6 +355,7 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
358 create a new menu for each sub and fill it. */ 355 create a new menu for each sub and fill it. */
359 if (submenu) 356 if (submenu)
360 { 357 {
358 const char *submenuTitle = [[submenu title] UTF8String];
361 for (wv = first_wv->contents; wv; wv = wv->next) 359 for (wv = first_wv->contents; wv; wv = wv->next)
362 { 360 {
363 if (!strcmp (submenuTitle, wv->name)) 361 if (!strcmp (submenuTitle, wv->name))