Menu

#7 AutoThread leaks file descriptors

open
nobody
None
5
2006-01-12
2006-01-12
No

The SocketServer class needs a virtual destructor. The missing virtual destructor causes AutoThread to leak file descriptors if it isn't initialized with a SocketServer, since the PhysicalSocketServer destructor isn't called when the socket server is deleted by MessageQueue.

--- base/socketserver.h (revision 2)
+++ base/socketserver.h (arbetskopia)
@@ -40,6 +40,8 @@
class SocketServer : public SocketFactory {
public:

+ virtual ~SocketServer() { }
+
// Performs I/O or sleeps for the given number of milliseconds.
// If process_io is false, just sleeps until WakeUp.
virtual bool Wait(int cms, bool process_io) = 0;

Discussion


Log in to post a comment.

MongoDB Logo MongoDB