mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
This should fix the use after free rare issue: C++ destroys class members in reverse declaration order. mProcess was declared before mHandlers. So during destruction, mHandlers was freed first, then mProcess destructor ran and joined the async read threads but by then the threads were already accessing freed memory.
This commit is contained in:
@@ -2119,7 +2119,6 @@ void LSPClientServer::processRequest( const json& msg ) {
|
||||
}
|
||||
|
||||
void LSPClientServer::readStdOut( const char* bytes, size_t n ) {
|
||||
BoolScopedOp op( mReadingStdOut );
|
||||
if ( mEnded )
|
||||
return;
|
||||
mReceive.append( bytes, n );
|
||||
@@ -2261,7 +2260,6 @@ void LSPClientServer::notifyServerError() {
|
||||
}
|
||||
|
||||
void LSPClientServer::readStdErr( const char* bytes, size_t n ) {
|
||||
BoolScopedOp op( mReadingStdErr );
|
||||
if ( mEnded )
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user