aboutsummaryrefslogtreecommitdiff
path: root/sysutils/synergy/files/patch-lib__platform__CXWindowsClipboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/synergy/files/patch-lib__platform__CXWindowsClipboard.cpp')
-rw-r--r--sysutils/synergy/files/patch-lib__platform__CXWindowsClipboard.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/sysutils/synergy/files/patch-lib__platform__CXWindowsClipboard.cpp b/sysutils/synergy/files/patch-lib__platform__CXWindowsClipboard.cpp
new file mode 100644
index 000000000000..dd40e23c82d3
--- /dev/null
+++ b/sysutils/synergy/files/patch-lib__platform__CXWindowsClipboard.cpp
@@ -0,0 +1,52 @@
+--- lib/platform/CXWindowsClipboard.cpp.orig 2006-04-02 09:47:03.000000000 +0800
++++ lib/platform/CXWindowsClipboard.cpp 2008-10-06 15:52:39.000000000 +0800
+@@ -219,7 +219,7 @@
+ if (reply->m_replied && reply->m_property == property) {
+ // if reply is complete then remove it and start the
+ // next one.
+- pushReplies(index, replies, index2);
++ pushReplies(index->first, replies, index2);
+ return true;
+ }
+ }
+@@ -928,17 +928,23 @@
+ {
+ // send the first reply for each window if that reply hasn't
+ // been sent yet.
+- for (CReplyMap::iterator index = m_replies.begin();
+- index != m_replies.end(); ++index) {
+- assert(!index->second.empty());
+- if (!index->second.front()->m_replied) {
+- pushReplies(index, index->second, index->second.begin());
++ CReplyMap::iterator index = m_replies.begin();
++ while (index != m_replies.end()) {
++ // increment index before calling pushReplies(...) as
++ // pushReplies(...) normally erases the member of the map, that
++ // index points to, invalidating index as iterator.
++ Window requestor = index->first;
++ CReplyList& replies = index->second;
++ index++;
++ assert(!replies.empty());
++ if (!replies.front()->m_replied) {
++ pushReplies(requestor, replies, replies.begin());
+ }
+ }
+ }
+
+ void
+-CXWindowsClipboard::pushReplies(CReplyMap::iterator mapIndex,
++CXWindowsClipboard::pushReplies(Window requestor,
+ CReplyList& replies, CReplyList::iterator index)
+ {
+ CReply* reply = *index;
+@@ -957,9 +963,8 @@
+ // and stop watching the requestor for events.
+ if (replies.empty()) {
+ CXWindowsUtil::CErrorLock lock(m_display);
+- Window requestor = mapIndex->first;
+ XSelectInput(m_display, requestor, m_eventMasks[requestor]);
+- m_replies.erase(mapIndex);
++ m_replies.erase(requestor);
+ m_eventMasks.erase(requestor);
+ }
+ }