FROM : Quincey Morris
DATE : Mon Apr 21 18:52:40 2008
On Apr 21, 2008, at 05:18, Antonio Nunes wrote:
> I'm trying to implement iChat Theater capability into my garbage
> collected app, and it looks to be almost working, except for a
> rather all important crash. When my app is notified that it should
> start sending video it executes the following code:
>
> IMAVManager *manager = [IMAVManager sharedAVManager];
> MyDocument *d;
>
> switch ([manager state])
> {
> case IMAVRequested:
> d = [[NSDocumentController sharedDocumentController]
> documentForURL:[manager URLToShare]];
> if (d == nil) {
> d = [[NSDocumentController sharedDocumentController]
> openDocumentWithContentsOfURL:[manager URLToShare] display:YES];
> }
> [manager setVideoDataSource:d.someView];
> [manager start];
> break;
> }
>
> someView has subviews, including a PDFView subclass. I have tried
> setting the data source to the PDFView and to the PDFView's
> documentView, but the result is always the same.
If d is a local variable, as this code fragment seems to say, what's
keeping it (and therefore d.someView) from getting garbage collected
as soon as it goes out of scope? 'setVideoDataSource' is documented to
*not* retain the view (in non-GC), and I would take such a statement
to mean that it does not hold a keep-alive reference to the object (in
GC) either.
DATE : Mon Apr 21 18:52:40 2008
On Apr 21, 2008, at 05:18, Antonio Nunes wrote:
> I'm trying to implement iChat Theater capability into my garbage
> collected app, and it looks to be almost working, except for a
> rather all important crash. When my app is notified that it should
> start sending video it executes the following code:
>
> IMAVManager *manager = [IMAVManager sharedAVManager];
> MyDocument *d;
>
> switch ([manager state])
> {
> case IMAVRequested:
> d = [[NSDocumentController sharedDocumentController]
> documentForURL:[manager URLToShare]];
> if (d == nil) {
> d = [[NSDocumentController sharedDocumentController]
> openDocumentWithContentsOfURL:[manager URLToShare] display:YES];
> }
> [manager setVideoDataSource:d.someView];
> [manager start];
> break;
> }
>
> someView has subviews, including a PDFView subclass. I have tried
> setting the data source to the PDFView and to the PDFView's
> documentView, but the result is always the same.
If d is a local variable, as this code fragment seems to say, what's
keeping it (and therefore d.someView) from getting garbage collected
as soon as it goes out of scope? 'setVideoDataSource' is documented to
*not* retain the view (in non-GC), and I would take such a statement
to mean that it does not hold a keep-alive reference to the object (in
GC) either.
| Related mails | Author | Date |
|---|---|---|
| Antonio Nunes | Apr 21, 14:18 | |
| Kevin Grant | Apr 21, 17:55 | |
| Antonio Nunes | Apr 21, 18:36 | |
| Quincey Morris | Apr 21, 18:52 | |
| Antonio Nunes | Apr 21, 19:32 | |
| Quincey Morris | Apr 21, 20:25 |






Cocoa mail archive

