comparison nodejs/shapes.cc @ 743:dd1f3382d6a4

Create a persistent handle for coords and shapes correctly
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 25 Aug 2010 13:58:49 +0800
parents 86c6ebf1de25
children 56a5e08cd8af
comparison
equal deleted inserted replaced
742:24038e7a365b 743:dd1f3382d6a4
16 /*! \defgroup xnjsmb_shapes JS binding for shapes. 16 /*! \defgroup xnjsmb_shapes JS binding for shapes.
17 * \ingroup xnjsmb 17 * \ingroup xnjsmb
18 * 18 *
19 * @{ 19 * @{
20 */ 20 */
21 static void
22 xnjsmb_shape_mod(Handle<Object> self, shape_t *sh) {
23 Persistent<Object> *self_hdl;
24
25 /* Keep associated js object in property store for retrieving,
26 * later, without create new js object.
27 */
28 self_hdl = new Persistent<Object>();
29 *self_hdl = Persistent<Object>::New(self);
30 mb_prop_set(&sh->obj.props, PROP_JSOBJ, self_hdl);
31 }
32
21 static void 33 static void
22 xnjsmb_sh_stext_set_style(shape_t *sh, Handle<Object> self, 34 xnjsmb_sh_stext_set_style(shape_t *sh, Handle<Object> self,
23 Handle<Value> blks, const char **err) { 35 Handle<Value> blks, const char **err) {
24 Array *blksobj; 36 Array *blksobj;
25 Array *blkobj; 37 Array *blkobj;