Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
d0b8c6eb
Commit
d0b8c6eb
authored
Apr 19, 2011
by
Max-Wilhelm Bruker
Browse files
changed mutex lock
parent
e978624e
Changes
2
Hide whitespace changes
Inline
Side-by-side
common/server_protocolhandler.cpp
View file @
d0b8c6eb
...
...
@@ -24,11 +24,12 @@ Server_ProtocolHandler::~Server_ProtocolHandler()
}
// This is essentially the destructor, but it needs to be called from the
// child's destructor with the server mutex locked. Otherwise, the mutex
// could get unlocked while the object is not finished being destroyed,
// leading to calls to pure virtual functions.
// child's destructor so that the server mutex does not get unlocked during
// finalization.
void
Server_ProtocolHandler
::
prepareDestroy
()
{
QMutexLocker
locker
(
&
server
->
serverMutex
);
server
->
removeClient
(
this
);
QMapIterator
<
int
,
Server_Room
*>
roomIterator
(
rooms
);
...
...
servatrice/src/serversocketinterface.cpp
View file @
d0b8c6eb
...
...
@@ -60,7 +60,6 @@ ServerSocketInterface::ServerSocketInterface(Servatrice *_server, QTcpSocket *_s
ServerSocketInterface
::~
ServerSocketInterface
()
{
QMutexLocker
locker
(
&
servatrice
->
serverMutex
);
logger
->
logMessage
(
"ServerSocketInterface destructor"
);
prepareDestroy
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment