-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcommon.cc
More file actions
36 lines (22 loc) · 668 Bytes
/
Copy pathcommon.cc
File metadata and controls
36 lines (22 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "common.h"
//namespace DirectFB
//{
v8::Handle<v8::Object>
Construct( v8::Handle<v8::ObjectTemplate> templ, void *interface )
{
v8::HandleScope handle_scope;
v8::Handle<v8::Object> obj = templ->NewInstance();
D_ASSERT( !obj.IsEmpty() );
obj->SetPointerInInternalField( 0, interface );
return handle_scope.Close( obj );
}
v8::Handle<v8::Value>
IAny_release( const v8::Arguments& args )
{
v8::Handle<v8::Object> obj = args.This();
IAny *thiz = V8_DIRECTFB_INTERFACE( obj, IAny );
V8_DIRECTFB_CALL( thiz->Release( thiz ) );
obj->SetPointerInInternalField( 0, NULL );
return v8::Undefined();
}
//}