Skip to content
Permalink
Browse files

Dev server workaround for processEvents

... because handleRequest calls qApp->processEvents
causing all kind of side effects in the standalone
server code (which is based on events) and even
crashes on deleteLater connections.

The original issue was the finish call invoking
plugins on deleted request handlers (not a crash
but still a bug).

This is a workaround while we decide if we can
remove the qApp->processEvents in the main server
handle request routine which has been there for
decades.
  • Loading branch information
elpaso committed May 21, 2020
1 parent 011168f commit 8c76c512241b024ca0b22d9a054aba50e0e803e3
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/server/qgis_mapserver.cpp
@@ -259,7 +259,7 @@ int main( int argc, char *argv[] )
};

// This will delete the connection when disconnected before ready read is called
clientConnection->connect( clientConnection, &QAbstractSocket::disconnected, context, connectionDeleter );
clientConnection->connect( clientConnection, &QAbstractSocket::disconnected, context, connectionDeleter, Qt::QueuedConnection );

// Incoming connection parser
clientConnection->connect( clientConnection, &QIODevice::readyRead, context, [ =, &server, &connCounter ] {
@@ -380,7 +380,7 @@ int main( int argc, char *argv[] )
if ( clientConnection->state() == QAbstractSocket::SocketState::ConnectedState )
{
clientConnection->connect( clientConnection, &QAbstractSocket::disconnected,
clientConnection, connectionDeleter );
clientConnection, connectionDeleter, Qt::QueuedConnection );
}
else
{
@@ -450,7 +450,7 @@ int main( int argc, char *argv[] )
clientConnection->disconnectFromHost();
}

} );
}, Qt::QueuedConnection );

} );

0 comments on commit 8c76c51

Please sign in to comment.
You can’t perform that action at this time.