fixed problem with opening client and server. in some cases it

would fail to open in such a way that it could never succeed
but it'd never stop retrying.  now terminating when open fails
such that it'll never succeed.
This commit is contained in:
crs
2002-07-31 12:39:34 +00:00
parent f5795a6630
commit 5e40de48f9
18 changed files with 141 additions and 59 deletions

View File

@@ -149,19 +149,18 @@ CClient::onClipboardChanged(ClipboardID, const CString&)
// ignore -- we'll check the clipboard when we leave
}
bool
void
CClient::open()
{
// open the screen
try {
log((CLOG_INFO "opening screen"));
openSecondaryScreen();
return true;
}
catch (XScreenOpenFailure&) {
// can't open screen yet. wait a few seconds to retry.
// can't open screen
log((CLOG_INFO "failed to open screen"));
return false;
throw;
}
}
@@ -368,7 +367,6 @@ void
CClient::openSecondaryScreen()
{
assert(m_screen == NULL);
assert(m_screenFactory != NULL);
// not active
m_active = false;
@@ -381,7 +379,9 @@ CClient::openSecondaryScreen()
// create screen
log((CLOG_DEBUG1 "creating secondary screen"));
m_screen = m_screenFactory->create(this);
if (m_screenFactory != NULL) {
m_screen = m_screenFactory->create(this);
}
if (m_screen == NULL) {
throw XScreenOpenFailure();
}
@@ -402,12 +402,12 @@ CClient::openSecondaryScreen()
void
CClient::closeSecondaryScreen()
{
assert(m_screen != NULL);
// close the secondary screen
try {
log((CLOG_DEBUG1 "closing secondary screen"));
m_screen->close();
if (m_screen != NULL) {
log((CLOG_DEBUG1 "closing secondary screen"));
m_screen->close();
}
}
catch (...) {
// ignore