Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
e2fb2fb4
Commit
e2fb2fb4
authored
Jun 17, 2021
by
Mark Nauwelaerts
Committed by
Christoph Cullmann
Jun 22, 2021
Browse files
lspclient: bypass shutdown delay if not needed and cleanup defunct code
BUG: 438790
parent
553dede8
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/lspclient/lspclientservermanager.cpp
View file @
e2fb2fb4
...
...
@@ -220,9 +220,6 @@ public:
// stage 3; send KILL
// stage 1
QEventLoop
q
;
QTimer
t
;
connect
(
&
t
,
&
QTimer
::
timeout
,
&
q
,
&
QEventLoop
::
quit
);
/* some msleep are used below which is somewhat BAD as it blocks/hangs
* the mainloop, however there is not much alternative:
...
...
@@ -246,34 +243,34 @@ public:
}
disconnect
(
s
.
data
(),
nullptr
,
this
,
nullptr
);
if
(
s
->
state
()
!=
LSPClientServer
::
State
::
None
)
{
auto
handler
=
[
&
q
,
&
count
,
s
]()
{
if
(
s
->
state
()
!=
LSPClientServer
::
State
::
None
)
{
if
(
--
count
==
0
)
{
q
.
quit
();
}
}
};
connect
(
s
.
data
(),
&
LSPClientServer
::
stateChanged
,
this
,
handler
);
++
count
;
s
->
stop
(
-
1
,
-
1
);
}
}
}
QThread
::
msleep
(
500
);
if
(
count
)
{
QThread
::
msleep
(
500
);
}
else
{
return
;
}
// stage 2 and 3
count
=
0
;
for
(
count
=
0
;
count
<
2
;
++
count
)
{
bool
wait
=
false
;
for
(
const
auto
&
el
:
m_servers
)
{
for
(
const
auto
&
si
:
el
)
{
auto
&
s
=
si
.
server
;
if
(
!
s
)
{
continue
;
}
wait
=
true
;
s
->
stop
(
count
==
0
?
1
:
-
1
,
count
==
0
?
-
1
:
1
);
}
}
QThread
::
msleep
(
100
);
if
(
wait
&&
count
==
0
)
{
QThread
::
msleep
(
100
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment