Browse Source

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

v0.7.4-release
Ryan 16 years ago
parent
commit
51e77c37b5
  1. 7
      src/net.h
  2. 2
      src/object_wrap.h

7
src/net.h

@ -128,7 +128,10 @@ protected:
server_.on_connection = Server::on_connection; server_.on_connection = Server::on_connection;
server_.data = this; server_.data = this;
} }
virtual ~Server () { Close(); }
virtual ~Server () {
oi_server_close (&server_);
}
int Listen (struct addrinfo *address) { int Listen (struct addrinfo *address) {
int r = oi_server_listen (&server_, address); int r = oi_server_listen (&server_, address);
@ -138,7 +141,7 @@ protected:
return 0; return 0;
} }
void Close ( ) { void Close ( ) {
oi_server_close (&server_); oi_server_close (&server_);
Detach(); Detach();
} }

2
src/object_wrap.h

@ -55,6 +55,8 @@ class ObjectWrap {
* the object after making this call as it might be gone! * the object after making this call as it might be gone!
* (A "weak reference" is v8 terminology for an object that only has a * (A "weak reference" is v8 terminology for an object that only has a
* persistant handle.) * persistant handle.)
*
* DO NOT CALL THIS FROM DESTRUCTOR
*/ */
void Detach() { void Detach() {
assert(!handle_.IsEmpty()); assert(!handle_.IsEmpty());

Loading…
Cancel
Save