Displaying 1 result from an estimated 1 matches for "thelocalvariable".
2012 Oct 02
1
[LLVMdev] Error prone default memory capturing convention of blocks.
...t place, not to rely on that tool will find it.
Proposition:
Any variable captured in block must have explicit qualifier to specify memory capturing semantic: __retain, __weak, __unsafe_unretained. Qualifier is obligatory, no defaults allowed.
Code will look something like this:
1)
NSString* theLocalVariable = …
...^ {
...
__weak self;
self.blabla = ...
…
[self blabla:(__retain theLocalVariable)];
}
2)
{
self.blabla = … // compile error: missing memory capture semantic qualifier.
....
}
For __block qualifier I propose to leave old behavior (leave the default __retain semantic), because ret...