mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-16 22:15:01 +03:00
Fixed a rare crash provoked by two factors:
* Fixed LSPDocumentClient::~LSPDocumentClient: It now explicitly calls `mDoc->unregisterClient(this);`. This ensures that whenever the client is destroyed—whether by the server shutting down or just the document closing—it cleanly detaches from the TextDocument. * Fixed `TextDocument::notifyDocumentClosed` Iterator Invalidation: Since `onDocumentClosed` is called during a loop over `mClients`, and `LSPDocumentClient` now unregisters itself during that exact same loop, it was modifying the `mClients` `std::unordered_set` while it was being iterated (which is undefined behavior). I changed `notifyDocumentClosed` to iterate over a copy of the clients, safely allowing clients to unregister themselves when they receive the notification.
This commit is contained in:
@@ -41,6 +41,7 @@ void LSPDocumentClient::setupFoldRangeService() {
|
||||
|
||||
LSPDocumentClient::~LSPDocumentClient() {
|
||||
mDoc->getFoldRangeService().setProvider( nullptr );
|
||||
mDoc->unregisterClient( this );
|
||||
mDoc = nullptr;
|
||||
UISceneNode* sceneNode = getUISceneNode();
|
||||
if ( nullptr != sceneNode && 0 != mTag )
|
||||
|
||||
Reference in New Issue
Block a user