… | |
… | |
488 | if (!ext->cb) |
488 | if (!ext->cb) |
489 | ext->cb = newAV (); |
489 | ext->cb = newAV (); |
490 | |
490 | |
491 | return newRV_inc ((SV *)ext->cb); |
491 | return newRV_inc ((SV *)ext->cb); |
492 | } |
492 | } |
493 | |
|
|
494 | #if 0 |
|
|
495 | void attachable::clear () |
|
|
496 | { |
|
|
497 | if (self) |
|
|
498 | { |
|
|
499 | // disconnect Perl from C, to avoid crashes |
|
|
500 | sv_unmagic (SvRV ((SV *)self), PERL_MAGIC_ext); |
|
|
501 | |
|
|
502 | // clear the perl hash, might or might not be a good idea |
|
|
503 | hv_clear ((HV *)SvRV ((SV *)self)); |
|
|
504 | |
|
|
505 | SvREFCNT_dec (self); |
|
|
506 | self = 0; |
|
|
507 | } |
|
|
508 | |
|
|
509 | if (cb) |
|
|
510 | { |
|
|
511 | SvREFCNT_dec (cb); |
|
|
512 | cb = 0; |
|
|
513 | } |
|
|
514 | |
|
|
515 | attach = 0; |
|
|
516 | } |
|
|
517 | #endif |
|
|
518 | |
493 | |
519 | ///////////////////////////////////////////////////////////////////////////// |
494 | ///////////////////////////////////////////////////////////////////////////// |
520 | |
495 | |
521 | extern "C" int cfperl_initPlugin (const char *iversion, f_plug_api gethooksptr) |
496 | extern "C" int cfperl_initPlugin (const char *iversion, f_plug_api gethooksptr) |
522 | { |
497 | { |