Fix uninitialized members outfd and infd

Also move initialization of some variables to initializers list.

Only the non-win32 part has been tested, but it should be OK.

Spotted by coverity.
This commit is contained in:
Jean-Marc Lasgouttes 2017-07-06 14:46:03 +02:00
parent 449b594a72
commit 02c9d2e67c

View File

@ -137,14 +137,14 @@ DWORD WINAPI pipeServerWrapper(void * arg)
LyXComm::LyXComm(string const & pip, Server * cli, ClientCallbackfct ccb)
: stopserver_(0), pipename_(pip), client_(cli), clientcb_(ccb)
: stopserver_(0),
ready_(false), pipename_(pip), client_(cli), clientcb_(ccb),
deferred_loading_(false)
{
for (int i = 0; i < MAX_PIPES; ++i) {
event_[i] = 0;
pipe_[i].handle = INVALID_HANDLE_VALUE;
}
ready_ = false;
deferred_loading_ = false;
openConnection();
}
@ -730,10 +730,10 @@ void LyXComm::send(string const & msg)
#else // defined (HAVE_MKFIFO)
LyXComm::LyXComm(string const & pip, Server * cli, ClientCallbackfct ccb)
: pipename_(pip), client_(cli), clientcb_(ccb)
: infd_(-1), outfd_(-1),
ready_(false), pipename_(pip), client_(cli), clientcb_(ccb),
deferred_loading_(false)
{
ready_ = false;
deferred_loading_ = false;
openConnection();
}