Fix memory leaks in LspEndpoint
This commit is contained in:
parent
b5d7829011
commit
59c48cdd62
@ -88,11 +88,14 @@ class LspEndpoint(threading.Thread):
|
|||||||
self.next_id += 1
|
self.next_id += 1
|
||||||
cond = threading.Condition()
|
cond = threading.Condition()
|
||||||
self.event_dict[current_id] = cond
|
self.event_dict[current_id] = cond
|
||||||
|
|
||||||
cond.acquire()
|
cond.acquire()
|
||||||
self.send_message(method_name, kwargs, current_id)
|
self.send_message(method_name, kwargs, current_id)
|
||||||
cond.wait()
|
cond.wait()
|
||||||
cond.release()
|
cond.release()
|
||||||
result, error = self.response_dict[current_id]
|
|
||||||
|
self.event_dict.pop(current_id)
|
||||||
|
result, error = self.response_dict.pop(current_id)
|
||||||
if error:
|
if error:
|
||||||
raise lsp_structs.ResponseError(error.get("code"), error.get("message"), error.get("data"))
|
raise lsp_structs.ResponseError(error.get("code"), error.get("message"), error.get("data"))
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user