/* X Selection processing for Emacs.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Emacs.
TRACE0 ("x_handle_selection_clear");
-#ifdef MULTI_KBOARD
/* If the new selection owner is also Emacs,
don't clear the new selection. */
BLOCK_INPUT;
}
}
UNBLOCK_INPUT;
-#endif
selection_symbol = x_atom_to_symbol (display, selection);
if (NILP (XCAR (reading_selection_reply)))
error ("Timed out waiting for reply from selection owner");
if (EQ (XCAR (reading_selection_reply), Qlambda))
- error ("No `%s' selection", SDATA (SYMBOL_NAME (selection_symbol)));
+ return Qnil;
/* Otherwise, the selection is waiting for us on the requested property. */
return
{
Window window;
Atom buffer_atom;
- unsigned char *data;
+ unsigned char *data = NULL;
int bytes;
Atom type;
int format;
x_get_window_property (display, window, buffer_atom, &data, &bytes,
&type, &format, &size, 0);
+
if (!data || !format)
- return Qnil;
+ {
+ if (data)
+ xfree (data);
+ return Qnil;
+ }
if (format != 8 || type != XA_STRING)
signal_error ("Cut buffer doesn't contain 8-bit data",