* src/lyxsocket.C

(LyXServerSocket::~LyXServerSocket): Don't try to unregister and
	close fd_ if the socket is disabled (avoids crash on win, from Peter
	KÃŒmmel)
	(LyXServerSocket::~LyXServerSocket): Check the return value of close()
	(LyXDataSocket::~LyXDataSocket): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13941 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-05-27 13:39:11 +00:00
parent 440ebe6385
commit 415e308cf4

View File

@ -74,8 +74,12 @@ LyXServerSocket::LyXServerSocket(LyXFunc * f, string const & addr)
// Close the socket and remove the address of the filesystem.
LyXServerSocket::~LyXServerSocket()
{
lyx_gui::unregister_socket_callback(fd_);
::close(fd_);
if (fd_ != -1) {
lyx_gui::unregister_socket_callback(fd_);
if (::close(fd_) != 0)
lyxerr << "lyx: Server socket " << fd_
<< " IO error on closing: " << strerror(errno);
}
lyx::support::unlink(address_);
lyxerr[Debug::LYXSERVER] << "lyx: Server socket quitting" << endl;
}
@ -201,7 +205,9 @@ LyXDataSocket::LyXDataSocket(int fd)
LyXDataSocket::~LyXDataSocket()
{
::close(fd_);
if (::close(fd_) != 0)
lyxerr << "lyx: Data socket " << fd_
<< " IO error on closing: " << strerror(errno);
lyx_gui::unregister_socket_callback(fd_);
lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_ << " quitting."