• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)


  • Subject: Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)
  • From: Stephen Sample <email@hidden>
  • Date: Fri, 7 Oct 2005 11:06:57 -0400


On Oct 6, 2005, at 3:12 PM, Sherm Pendley wrote:

On Oct 6, 2005, at 8:39 AM, Stephen Sample wrote:


But looking at the examples for CamelBones (and any other tutorials online), I can't figure out how to release the memory for the Cocoa objects from within Perl. My case is somewhat different in that I don't have a UI, and so I'm basically running a straight Perl.

Use CamelBones from command-line tools is a relatively recent addition - which is why this has escaped testing until now.

No problem. I'm sort of reassured that it's not just me ;-)

I've tried the Cocoa-style

     $cocoaObjectName->release;

but that gives me an error of

perl[5912] Unknown return type Vv

Vv is the type encoding for "oneway void", which is the declared return type for -release. Sure enough, that's not supported yet. It'll be trivial for me to add support for it, certainly - it's void, so there's nothing to support. ;-)


It'll take me a day or so to patch the code and make a release.

Great, thanks!

In the meantime, I found a workaround that at least doesn't blow up-- splitting the scale subroutine into another Perl program and calling it with system() lets Perl clean the memory up properly. It's not elegant, but it lets me go on with the rest of the testing.


Oh, and BTW, in case anyone else runs into this, it looks like enum values don't get carried through from Cocoa to Perl via CamelBones. If I try compressing an image to JPEG using


$scaledNSBitmapImageRep->representationUsingType_properties (NSJPEGFileType,$compressionSettings);

I get a TIFF. But if I use the

my $outputJPEGData = $scaledNSBitmapImageRep- >representationUsingType_properties(3,$compressionSettings);

(where 3 is the position of NSJPEGFileType in the enum), I get a JPEG.


Not a big deal, but I thought it might save someone some debugging if I mentioned it.



Ta, -Stephen

-----------------------------------------
     Stephen Sample, NPPA Web Developer
+919/383-7246 x11, <email@hidden>


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)
      • From: Sherm Pendley <email@hidden>
References: 
 >How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones) (From: Stephen Sample <email@hidden>)
 >Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones) (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Core Data Insert and editColumn:row:withEvent:select: [SOLVED]
  • Next by Date: Context menu for NSTableView cell
  • Previous by thread: Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)
  • Next by thread: Re: How to release Cocoa objects from Perl? (PerlObjCBridge or CamelBones)
  • Index(es):
    • Date
    • Thread