Lines 313-319
gjs_cairo_context_finalize(JSContext *co
Link Here
|
313 |
if (priv == NULL) |
313 |
if (priv == NULL) |
314 |
return; |
314 |
return; |
315 |
|
315 |
|
316 |
cairo_destroy(priv->cr); |
316 |
if (priv->cr != NULL) |
|
|
317 |
cairo_destroy(priv->cr); |
318 |
|
317 |
g_slice_free(GjsCairoContext, priv); |
319 |
g_slice_free(GjsCairoContext, priv); |
318 |
} |
320 |
} |
319 |
|
321 |
|
Lines 403-408
_GJS_CAIRO_CONTEXT_DEFINE_FUNC2FFAFF(use
Link Here
|
403 |
|
405 |
|
404 |
|
406 |
|
405 |
static JSBool |
407 |
static JSBool |
|
|
408 |
dispose_func(JSContext *context, |
409 |
unsigned argc, |
410 |
jsval *vp) |
411 |
{ |
412 |
JSObject *obj = JS_THIS_OBJECT(context, vp); |
413 |
GjsCairoContext *priv; |
414 |
|
415 |
priv = priv_from_js(context, obj); |
416 |
if (priv->cr != NULL) { |
417 |
cairo_destroy(priv->cr); |
418 |
priv->cr = NULL; |
419 |
} |
420 |
JS_SET_RVAL(context, vp, JSVAL_VOID); |
421 |
return JS_TRUE; |
422 |
} |
423 |
|
424 |
static JSBool |
406 |
appendPath_func(JSContext *context, |
425 |
appendPath_func(JSContext *context, |
407 |
uintN argc, |
426 |
uintN argc, |
408 |
jsval *vp) |
427 |
jsval *vp) |
Lines 852-857
getGroupTarget_func(JSContext *context,
Link Here
|
852 |
} |
871 |
} |
853 |
|
872 |
|
854 |
static JSFunctionSpec gjs_cairo_context_proto_funcs[] = { |
873 |
static JSFunctionSpec gjs_cairo_context_proto_funcs[] = { |
|
|
874 |
{ "$dispose", (JSNative)dispose_func, 0, 0 }, |
855 |
{ "appendPath", (JSNative)appendPath_func, 0, 0}, |
875 |
{ "appendPath", (JSNative)appendPath_func, 0, 0}, |
856 |
{ "arc", (JSNative)arc_func, 0, 0 }, |
876 |
{ "arc", (JSNative)arc_func, 0, 0 }, |
857 |
{ "arcNegative", (JSNative)arcNegative_func, 0, 0 }, |
877 |
{ "arcNegative", (JSNative)arcNegative_func, 0, 0 }, |