]> git.lyx.org Git - features.git/commitdiff
remove io callback on shutdown
authorJohn Levon <levon@movementarian.org>
Tue, 30 Jul 2002 22:35:43 +0000 (22:35 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 30 Jul 2002 22:35:43 +0000 (22:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4811 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/ChangeLog
src/frontends/lyx_gui.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/lyx_gui.C
src/lyxserver.C
src/lyxserver.h

index 5f1a60c901ca453057d7e3a0c773bb97d3903054..4e4aa4e6e00b9605305e16c2125899467daab8bc 100644 (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
index b946f93e9c63ec1c9b09fecd33c2b70c2871669d..87a176ab5ff45edb58e67723b66c386a92f1e67b 100644 (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()
index 741688a3114ef9808d795e032d1526732d0b169a..109bb3d2294255c7fd91cc6bf3a55dfdf0643192 100644 (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
index 5e7901aa1e6fecffbc11298f518eb4efd7fe4d9c..bdf64be72855418b6be8b01f24a6c72bd0979a8c 100644 (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
index b424142506bfe265b34320c20d54ee34885787b5..05b418dc3c7f4850f484b11ece35bf5a7533eee3 100644 (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);
+}
index e9692fd6f48e02ba44862c674a994fe8d40075ff..9f64d8f9be005c9af5a405c00dec14e1371cea67 100644 (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);
        }
 }
 
index f6d38868db55c5a67440bf7d2e095a8e4088f277..3a3c180776645a62becc439539e62da77a7c8afd 100644 (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;