mirror of https://github.com/nodejs/node.git
Do not call Detach() from Server::~Server.
parent
22c3a1e2a5
commit
51e77c37b5
|
@ -128,7 +128,10 @@ protected:
|
|||
server_.on_connection = Server::on_connection;
|
||||
server_.data = this;
|
||||
}
|
||||
virtual ~Server () { Close(); }
|
||||
|
||||
virtual ~Server () {
|
||||
oi_server_close (&server_);
|
||||
}
|
||||
|
||||
int Listen (struct addrinfo *address) {
|
||||
int r = oi_server_listen (&server_, address);
|
||||
|
@ -138,7 +141,7 @@ protected:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void Close ( ) {
|
||||
void Close ( ) {
|
||||
oi_server_close (&server_);
|
||||
Detach();
|
||||
}
|
||||
|
|
|
@ -55,6 +55,8 @@ class ObjectWrap {
|
|||
* the object after making this call as it might be gone!
|
||||
* (A "weak reference" is v8 terminology for an object that only has a
|
||||
* persistant handle.)
|
||||
*
|
||||
* DO NOT CALL THIS FROM DESTRUCTOR
|
||||
*/
|
||||
void Detach() {
|
||||
assert(!handle_.IsEmpty());
|
||||
|
|
Loading…
Reference in New Issue