Permalink
Browse files

Fix UVData::VoidToObject

  • Loading branch information...
creationix committed Mar 22, 2012
1 parent 1e8941e commit 6766625b71ef38a2a3582d809553a33f9aec6947
Showing with 2 additions and 6 deletions.
  1. +2 −6 src/luv.cc
View
@@ -3,8 +3,6 @@
#include "candor.h"
#include "uv.h"
-#include <stdio.h>
-
using namespace candor;
template uv_handle_t* UVData::ObjectTo<uv_handle_t>(candor::Object* obj);
@@ -24,9 +22,8 @@ UVData::UVData(size_t size, Object* prototype) {
// Create a uv structure
handle = (uv_handle_t*)new char[size];
- printf("uv_handle_t* %p\n", handle);
// And point it to us too.
- handle->data = &obj;
+ handle->data = this;
}
UVData::~UVData() {
@@ -39,10 +36,9 @@ UVData::~UVData() {
template <class T>
T* UVData::ObjectTo(candor::Object* obj) {
uv_handle_t* handle = CWrapper::Unwrap<UVData>(obj->Get("cdata"))->handle;
- printf("handle %p\n", handle);
return (T*)handle;
}
Object* UVData::VoidToObject(void* ptr) {
- return *((Handle<Object>)(Object*)ptr);
+ return *((UVData*)ptr)->obj;
}

0 comments on commit 6766625

Please sign in to comment.