1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-15 03:14:23 +00:00

- Fix synergy crashing on copy and paste from Fedora

- Bump PORTREVISION

Tested by:	Pascal <pascal at dodeca-t dot com>
This commit is contained in:
Kevin Lo 2008-10-13 06:56:57 +00:00
parent 862182f2a9
commit 544b16a3e0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=221520
3 changed files with 64 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= synergy
PORTVERSION= 1.3.1
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}2

View File

@ -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);
}
}

View File

@ -0,0 +1,11 @@
--- lib/platform/CXWindowsClipboard.h.orig 2008-10-06 14:51:40.000000000 +0800
+++ lib/platform/CXWindowsClipboard.h 2008-10-06 14:52:33.000000000 +0800
@@ -265,7 +265,7 @@
bool insertMultipleReply(Window, ::Time, Atom);
void insertReply(CReply*);
void pushReplies();
- void pushReplies(CReplyMap::iterator,
+ void pushReplies(Window requestor,
CReplyList&, CReplyList::iterator);
bool sendReply(CReply*);
void clearReplies();