Do not call Detach() from Server::~Server.

pull/22966/head
Ryan 2009-07-11 11:43:06 +02:00
parent 22c3a1e2a5
commit 51e77c37b5
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -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());