mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Drop the redundant database interface cast (#7826)
The socket-handler constructor already takes Servatrice_DatabaseInterface *, so the reinterpret_cast from the base member to the same type adds nothing and would silently hide a wrong implementation if a different database type were ever injected. Initialize sqlInterface from the typed constructor parameter instead.
This commit is contained in:
parent
505c3b62dc
commit
90b3013db6
1 changed files with 1 additions and 2 deletions
|
|
@ -195,8 +195,7 @@ static const int MAX_TCP_MESSAGE_SIZE = 1500000;
|
||||||
AbstractServerSocketInterface::AbstractServerSocketInterface(Servatrice *_server,
|
AbstractServerSocketInterface::AbstractServerSocketInterface(Servatrice *_server,
|
||||||
Servatrice_DatabaseInterface *_databaseInterface,
|
Servatrice_DatabaseInterface *_databaseInterface,
|
||||||
QObject *parent)
|
QObject *parent)
|
||||||
: Server_ProtocolHandler(_server, _databaseInterface, parent), servatrice(_server),
|
: Server_ProtocolHandler(_server, _databaseInterface, parent), servatrice(_server), sqlInterface(_databaseInterface)
|
||||||
sqlInterface(reinterpret_cast<Servatrice_DatabaseInterface *>(databaseInterface))
|
|
||||||
{
|
{
|
||||||
// Never call flushOutputQueue directly from outputQueueChanged. In case of a socket error,
|
// Never call flushOutputQueue directly from outputQueueChanged. In case of a socket error,
|
||||||
// it could lead to this object being destroyed while another function is still on the call stack. -> mutex
|
// it could lead to this object being destroyed while another function is still on the call stack. -> mutex
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue