diff options
author | Hans de Goede <hdegoede@redhat.com> | 2010-10-04 12:15:45 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2010-10-04 14:41:23 +0200 |
commit | ca3d29029455cbb3441a5a7715f43638f3d54d1c (patch) | |
tree | 51a16185dc816a96965be284dffad2ba7ff0d0e5 | |
parent | ff434c288f87a1a08a2cf1e58260daea68914769 (diff) |
spicec-x11: If the clipboard was large return the memory to the system
-rw-r--r-- | client/x11/platform.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/x11/platform.cpp b/client/x11/platform.cpp index dc0787f0..c6b2d7de 100644 --- a/client/x11/platform.cpp +++ b/client/x11/platform.cpp @@ -2445,7 +2445,14 @@ exit: static void get_selection_free(unsigned char *data, bool incr) { - if (!incr && data) + if (incr) { + /* If the clipboard was large return the memory to the system */ + if (clipboard_data_space > 512 * 1024) { + free(clipboard_data); + clipboard_data = NULL; + clipboard_data_space = 0; + } + } else if (data) XFree(data); } |