mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-11 04:23:29 -08:00
[Server] Drop the redundant database interface cast
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
3b379618c3
commit
9677c953a0
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,
|
||||
Servatrice_DatabaseInterface *_databaseInterface,
|
||||
QObject *parent)
|
||||
: Server_ProtocolHandler(_server, _databaseInterface, parent), servatrice(_server),
|
||||
sqlInterface(reinterpret_cast<Servatrice_DatabaseInterface *>(databaseInterface))
|
||||
: Server_ProtocolHandler(_server, _databaseInterface, parent), servatrice(_server), sqlInterface(_databaseInterface)
|
||||
{
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue