+2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
+ to ns_term_init to avoid memory leak.
+
+ * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
+ explicit retain/release.
+ (ns_term_init): Only allow one display. Initialize outerpool and
+ ns_*_types.
+
2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
Port _setjmp fix to POSIXish hosts as well as Microsoft.
SSDATA (display));
}
- /* Register our external input/output types, used for determining
- applicable services and also drag/drop eligibility. */
- ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain];
- ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil]
- retain];
- ns_drag_types = [[NSArray arrayWithObjects:
- NSStringPboardType,
- NSTabularTextPboardType,
- NSFilenamesPboardType,
- NSURLPboardType,
- NSColorPboardType,
- NSFontPboardType, nil] retain];
-
return Qnil;
}
{
NSView *view = FRAME_NS_VIEW (f);
NSRect r = [view frame];
- NSBezierPath *bp = [NSBezierPath bezierPath];
+ NSBezierPath *bp;
NSTRACE (ns_update_begin);
ns_update_auto_hide_menu_bar ();
is for the minibuffer. But the display engine may draw more because
we have set the frame as garbaged. So reset clip path to the whole
view. */
- [bp appendBezierPathWithRect: r];
+ bp = [[NSBezierPath bezierPathWithRect: r] retain];
[bp setClip];
+ [bp release];
#ifdef NS_IMPL_GNUSTEP
uRect = NSMakeRect (0, 0, 0, 0);
static int ns_initialized = 0;
Lisp_Object tmp;
+ if (ns_initialized) return x_display_list;
+ ns_initialized = 1;
+
NSTRACE (ns_term_init);
+ [outerpool release];
+ outerpool = [[NSAutoreleasePool alloc] init];
+
/* count object allocs (About, click icon); on OS X use ObjectAlloc tool */
/*GSDebugAllocationActive (YES); */
BLOCK_INPUT;
handling_signal = 0;
- if (!ns_initialized)
- {
- baud_rate = 38400;
- Fset_input_interrupt_mode (Qnil);
+ baud_rate = 38400;
+ Fset_input_interrupt_mode (Qnil);
- if (selfds[0] == -1)
+ if (selfds[0] == -1)
+ {
+ if (pipe (selfds) == -1)
{
- if (pipe (selfds) == -1)
- {
- fprintf (stderr, "Failed to create pipe: %s\n",
- emacs_strerror (errno));
- emacs_abort ();
- }
-
- fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL));
- FD_ZERO (&select_readfds);
- FD_ZERO (&select_writefds);
- pthread_mutex_init (&select_mutex, NULL);
+ fprintf (stderr, "Failed to create pipe: %s\n",
+ emacs_strerror (errno));
+ emacs_abort ();
}
- ns_initialized = 1;
+
+ fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL));
+ FD_ZERO (&select_readfds);
+ FD_ZERO (&select_writefds);
+ pthread_mutex_init (&select_mutex, NULL);
}
ns_pending_files = [[NSMutableArray alloc] init];
}
#endif /* MAC OS X menu setup */
+ /* Register our external input/output types, used for determining
+ applicable services and also drag/drop eligibility. */
+ ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain];
+ ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil]
+ retain];
+ ns_drag_types = [[NSArray arrayWithObjects:
+ NSStringPboardType,
+ NSTabularTextPboardType,
+ NSFilenamesPboardType,
+ NSURLPboardType,
+ NSColorPboardType,
+ NSFontPboardType, nil] retain];
+
+
[NSApp run];
ns_do_open_file = YES;
return dpyinfo;