Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 23 Oct 2014, at 04:31, Greg Parker wrote: > > >> On Oct 22, 2014, at 12:04 PM, Gerriet M. Denkmann >> wrote: >> >>> On 23 Oct 2014, at 01:37, Scott Ribe wrote: >>> >>> On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell >>> wrote: Surely the code that returns the object point

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Greg Parker
> On Oct 22, 2014, at 12:04 PM, Gerriet M. Denkmann > wrote: > >> On 23 Oct 2014, at 01:37, Scott Ribe wrote: >> >> On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell >> wrote: >>> >>> Surely the code that returns the object pointed to by temp has to ensure >>> that the object has been corre

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
> On Oct 22, 2014, at 1:04 PM, Gerriet M. Denkmann wrote: > > So, indeed, __autoreleasing seems to be the answer. > ( __autoreleasing is used to denote arguments that are passed by reference > (id *) and are autoreleased on return.) Honestly, my read was that it was for by-reference arguments

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 23 Oct 2014, at 01:37, Scott Ribe wrote: > > On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell > wrote: >> >> Surely the code that returns the object pointed to by temp has to ensure >> that the object has been correctly retained? > > So, maybe __autorelease? Tried: [ iv invoke ]; NSDic

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 12:19 PM, Jonathan Mitchell wrote: > > Surely the code that returns the object pointed to by temp has to ensure that > the object has been correctly retained? So, maybe __autorelease? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voi

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 12:10 PM, Gerriet M. Denkmann wrote: > > I tried, but got told: "error: ARC forbids explicit message send of 'retain'". Yep, makes sense. Is the method signature's method return type correct? If so, your two options would seem to be: - one of those compiler incantations wit

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Jonathan Mitchell
> On 22 Oct 2014, at 19:10, Gerriet M. Denkmann wrote: > > >> On 23 Oct 2014, at 01:02, Scott Ribe wrote: >> >> On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann >> wrote: >>> >>> But how to fix this? >> >> ARC expects a retained pointer; I'd retain it. > > I tried, but got told: "error

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 23 Oct 2014, at 01:02, Scott Ribe wrote: > > On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann > wrote: >> >> But how to fix this? > > ARC expects a retained pointer; I'd retain it. I tried, but got told: "error: ARC forbids explicit message send of 'retain'". NSDictionary *temp; [ iv

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann wrote: > > But how to fix this? Can you actually retain a pointer that ARC expects to be already retained, or would be it a NOOP? Sorry, I only use manual memory management, so my previous reply may have been off-base. -- Scott Ribe scott_r.

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Scott Ribe
On Oct 22, 2014, at 11:46 AM, Gerriet M. Denkmann wrote: > > But how to fix this? ARC expects a retained pointer; I'd retain it. Things can get weird when calling across boundaries like NSInvocation, or function pointers, or whatever. Even weirder when the calls go between different threads.

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Kyle Sluder
On Wed, Oct 22, 2014, at 12:46 PM, Gerriet M. Denkmann wrote: > This seems to prove your guess that " the bug is the call to > -getReturnValue:". > > But how to fix this? Rewrite your API to take an array of blocks instead? --Kyle Sluder ___ Cocoa-dev

Re: NSInvocation crashes in AutoreleasePool

2014-10-22 Thread Gerriet M. Denkmann
> On 22 Oct 2014, at 03:17, Greg Parker wrote: > > >> On Oct 21, 2014, at 2:44 AM, Gerriet M. Denkmann >> wrote: >> >> 10.10, Xcode 6.1, using Arc. >> >> The following code works fine, with USE_INVOCATION defined or not: > > [...] > >> Without USE_INVOCATION defined, I get some compiler w

Re: NSInvocation crashes in AutoreleasePool

2014-10-21 Thread Greg Parker
> On Oct 21, 2014, at 2:44 AM, Gerriet M. Denkmann wrote: > > 10.10, Xcode 6.1, using Arc. > > The following code works fine, with USE_INVOCATION defined or not: [...] > Without USE_INVOCATION defined, I get some compiler warning about potential > leaks, because selector is unknown. > > But