Permalink
Browse files

cleanup scope hanler opened and not closed

  • Loading branch information...
1 parent 66c7205 commit e3e5bb8884ce81ff0a1ff41ec8793ccfa68207d0 @schamane committed Jul 6, 2012
Showing with 3 additions and 11 deletions.
  1. +2 −10 syslog.cc
  2. +1 −1 test.js
View
12 syslog.cc
@@ -13,8 +13,6 @@ char Syslog::name[1024];
void
Syslog::Initialize ( Handle<Object> target)
{
- HandleScope scope;
-
Local<FunctionTemplate> t = FunctionTemplate::New();
constructor_template = Persistent<FunctionTemplate>::New(t);
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
@@ -33,7 +31,7 @@ Handle<Value>
Syslog::init ( const Arguments& args)
{
HandleScope scope;
-
+
if (args.Length() == 0 || !args[0]->IsString()) {
return ThrowException(Exception::Error(
String::New("Must give daemonname string as argument")));
@@ -66,8 +64,6 @@ static void UV_AfterLog(uv_work_t *req) {
#else
static int EIO_AfterLog( eio_req *req) {
#endif
- HandleScope scope;
-
struct log_request *log_req = (struct log_request *)(req->data);
log_req->cb.Dispose(); // is this necessary?
@@ -142,11 +138,8 @@ Syslog::log ( const Arguments& args)
Handle<Value>
Syslog::destroy ( const Arguments& args)
{
- HandleScope scope;
-
close();
-
- return scope.Close(Undefined());
+ return Undefined();
}
void
@@ -202,6 +195,5 @@ Syslog::close ()
extern "C" void
init (Handle<Object> target)
{
- HandleScope scope;
Syslog::Initialize(target);
}
View
2 test.js
@@ -4,5 +4,5 @@ Syslog.init("node-syslog-test", Syslog.LOG_PID | Syslog.LOG_ODELAY, Syslog.LOG_L
Syslog.log(Syslog.LOG_INFO, "news info log test");
Syslog.log(Syslog.LOG_ERR, "news log error test");
Syslog.log(Syslog.LOG_DEBUG, "Last log message as debug: " + new Date());
-
+Syslog.close();

0 comments on commit e3e5bb8

Please sign in to comment.