remove io callback on shutdown

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4811 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-07-30 22:35:43 +00:00
parent 7534cb5d5e
commit 2e218e3263
7 changed files with 35 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2002-07-30 John Levon <levon@movementarian.org>
* lyxserver.h:
* lyxserver.C: remove I/O callback too
2002-07-30 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* lyxfunc.C (getStatus): disable LFUN_LATEX_LOG when there is no

View File

@ -1,3 +1,7 @@
2002-07-30 John Levon <levon@movementarian.org>
* lyx_gui.h: add remove_read_callback()
2002-07-22 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.h: add exit()

View File

@ -65,6 +65,11 @@ namespace lyx_gui {
* add a callback for I/O read notification
*/
void set_read_callback(int fd, LyXComm * comm);
/**
* remove a I/O read callback
*/
void remove_read_callback(int fd);
}
#endif // LYX_GUI_H

View File

@ -1,3 +1,7 @@
2002-07-30 John Levon <levon@movementarian.org>
* lyx_gui.C: implement remove_read_callback()
2002-07-26 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* XWorkArea.C (work_area_handler): change type of

View File

@ -377,3 +377,9 @@ void lyx_gui::set_read_callback(int fd, LyXComm * comm)
{
fl_add_io_callback(fd, FL_READ, C_read_callback, comm);
}
void lyx_gui::remove_read_callback(int fd)
{
fl_remove_io_callback(fd, FL_READ, C_read_callback);
}

View File

@ -99,7 +99,7 @@ void LyXComm::openConnection()
return;
if ((outfd = startPipe(outPipeName(), true)) == -1) {
endPipe(infd, inPipeName());
endPipe(infd, inPipeName(), false);
return;
}
@ -132,8 +132,8 @@ void LyXComm::closeConnection()
return;
}
endPipe(infd, inPipeName());
endPipe(outfd, outPipeName());
endPipe(infd, inPipeName(), false);
endPipe(outfd, outPipeName(), true);
ready = false;
}
@ -207,11 +207,15 @@ int LyXComm::startPipe(string const & filename, bool write)
}
void LyXComm::endPipe(int & fd, string const & filename)
void LyXComm::endPipe(int & fd, string const & filename, bool write)
{
if (fd < 0)
return;
if (!write) {
lyx_gui::remove_read_callback(fd);
}
#ifdef __EMX__
APIRET rc;
int errnum;
@ -245,8 +249,8 @@ void LyXComm::endPipe(int & fd, string const & filename)
void LyXComm::emergencyCleanup()
{
if (!pipename.empty()) {
endPipe(infd, inPipeName());
endPipe(outfd, outPipeName());
endPipe(infd, inPipeName(), false);
endPipe(outfd, outPipeName(), true);
}
}

View File

@ -82,7 +82,7 @@ private:
int startPipe(string const &, bool);
/// finish a pipe
void endPipe(int &, string const &);
void endPipe(int &, string const &, bool);
/// This is -1 if not open
int infd;