Permalink
Browse files

Protect as_script from garbage collection

Intended to fix crash in ns_do_applescript

(In the 2.x branch, a previous fix to generate NSStrings should have
circumvented the crash, too.)

Conflicts:
	aquamacs/doc/latex/changelog.tex
	src/nsfns.m
  • Loading branch information...
1 parent 712b4c3 commit 1f72395591846cb1170098ca57a0400fc156c6ad @davidswelt davidswelt committed Jan 5, 2014
Showing with 16 additions and 15 deletions.
  1. +1 −0 aquamacs/doc/latex/changelog.tex
  2. +15 −15 src/nsfns.m
@@ -14,6 +14,7 @@ \subsection{Changes--- 2.x}
\item Clicking on the Aquamacs dock icon will again create a new buffer or de-minimize a window, as is standard on OS X.
Reported by Guy Gascoigne-Piggford.
\item Aquamacs now requires OS X 10.6 or later as a build system.
+\item A certain rare crash when viewing a compiled LaTeX file (and in other situations) has been addressed. Thanks to all who reported it.
\end{itemize}
\subsection{Changes--- 2.5}
View
@@ -127,7 +127,7 @@ Updated by Christian Limpach (chris@nice.ch)
/* Nonzero if we can use mouse menus. */
int
have_menus_p ()
-{
+ {
return NSApp != nil;
}
@@ -188,7 +188,7 @@ Updated by Christian Limpach (chris@nice.ch)
if (! FRAME_NS_P (f))
error ("non-Nextstep frame used");
return FRAME_NS_DISPLAY_INFO (f);
- }
+}
return NULL; /* shut compiler up */
}
@@ -256,7 +256,7 @@ Updated by Christian Limpach (chris@nice.ch)
Lisp_Object tem;
tem = Fstring_equal (XCAR (XCAR (names)), name);
if (!NILP (tem))
- return dpyinfo;
+ return dpyinfo;
}
error ("Emacs for OpenStep does not yet support multi-display.");
@@ -900,7 +900,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
/* Make sure the cursor gets redrawn. */
cursor_type_changed = 1;
}
-
+
/* called to set mouse pointer color, but all other terms use it to
initialize pointer types (and don't set the color ;) */
@@ -921,7 +921,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
#ifdef NS_IMPL_GNUSTEP
sprintf(tmp, "gnustep-gui-%s", Xstr(GNUSTEP_GUI_VERSION));
-#elif defined(NS_IMPL_COCOA)
+#elif defined (NS_IMPL_COCOA)
sprintf(tmp, "apple-appkit-%.2f", NSAppKitVersionNumber);
#else
tmp = "ns-unknown";
@@ -938,7 +938,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
{
#ifdef NS_IMPL_GNUSTEP
return GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION;
-#elif defined(NS_IMPL_COCOA)
+#elif defined (NS_IMPL_COCOA)
return (int)NSAppKitVersionNumber;
#endif
return 0;
@@ -1356,7 +1356,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
(arg)
Lisp_Object arg;
{
- [NSApp _cycleWindowsReversed:(NILP(arg) ? FALSE : TRUE)];
+ [NSApp _cycleWindowsReversed:(NILP(arg) ? FALSE : TRUE)];
return Qnil;
}
@@ -1782,7 +1782,7 @@ cons cell of form (beginning . length), or nil if all
CHECK_FRAME (frame);
f = XFRAME (frame);
}
-
+
if (! NILP (face))
{
int face_id = lookup_named_face (f, face, 1);
@@ -1991,11 +1991,11 @@ cons cell of form (beginning . length), or nil if all
modalDelegate:NSApp // it's EmacsApp
didEndSelector:@selector(savePanelDidEnd2:returnCode:contextInfo:)
contextInfo:current_buffer];
-
+
ns_update_menubar (SELECTED_FRAME (), 0, nil);
-
+
[panel release];
-
+
/* make stick */
// [NSApp setMainMenu: panelMenu];
@@ -2067,7 +2067,7 @@ cons cell of form (beginning . length), or nil if all
ret = (ret == NSOKButton) || panelOK;
- if (ret)
+ if (ret)
fname = build_string ([[panel filename] UTF8String]);
[[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow];
@@ -2717,7 +2717,7 @@ and GNUstep implementations ("distributor-specific release
[NSApp postEvent: nxev atStart: NO];
[NSApp run];
-
+
status = as_status;
as_status = 0;
as_script = nil;
@@ -3160,7 +3160,7 @@ OSStatus odb_event (struct buffer *buffer,
Note that color displays do support shades of gray.
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame, a display name (a string), or terminal ID.
-If omitted or nil, that stands for the selected frame's display. */)
+If omitted or nil, that stands for the selected frame's display. */)
(display)
Lisp_Object display;
{
@@ -3327,7 +3327,7 @@ The return value is a list of integers (LEFT TOP WIDTH HEIGHT), which
else
/* Put it on the top. */
*root_y = vScreen.origin.y + vScreen.size.height - height;
- }
+}
DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,

0 comments on commit 1f72395

Please sign in to comment.