]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/PreviewLoader.cpp
Remove obsolete (and false) comment.
[lyx.git] / src / graphics / PreviewLoader.cpp
index 22b0f23ead20d78025e22ef09130f0491bc68c83..d9133d9a7dc09763938061fd92963d71d839aa59 100644 (file)
@@ -217,7 +217,6 @@ private:
 
        /** in_progress_ stores all forked processes so that we can proceed
         *  thereafter.
-           The map uses the conversion commands as its identifiers.
         */
        InProgressProcesses in_progress_;
 
@@ -239,7 +238,7 @@ private:
        /// We don't own this
        static lyx::Converter const * pconverter_;
 
-       signals2::scoped_connection connection_;
+       Trackable trackable_;
 };
 
 
@@ -727,7 +726,8 @@ void PreviewLoader::Impl::startLoading(bool wait)
        if (wait) {
                ForkedCall call(buffer_.filePath(), buffer_.layoutPos());
                int ret = call.startScript(ForkedProcess::Wait, command);
-               static atomic_int fake((2^20) + 1);
+               // PID_MAX_LIMIT is 2^22 so we start one after that
+               static atomic_int fake((1 << 22) + 1);
                int pid = fake++;
                inprogress.pid = pid;
                inprogress.command = command;
@@ -738,10 +738,9 @@ void PreviewLoader::Impl::startLoading(bool wait)
 
        // Initiate the conversion from LaTeX to bitmap images files.
        ForkedCall::sigPtr convert_ptr = make_shared<ForkedCall::sig>();
-       // This is a scoped connection
-       connection_ = convert_ptr->connect([this](pid_t pid, int retval){
-                       finishedGenerating(pid, retval);
-               });
+       convert_ptr->connect(ForkedProcess::slot([this](pid_t pid, int retval){
+                               finishedGenerating(pid, retval);
+                       }).track_foreign(trackable_.p()));
 
        ForkedCall call(buffer_.filePath());
        int ret = call.startScript(command, convert_ptr);