uiViewForAudioUnit released immediately?
uiViewForAudioUnit released immediately?
- Subject: uiViewForAudioUnit released immediately?
- From: "Mark's Studio" <email@hidden>
- Date: Fri, 4 Jun 2004 18:11:40 +0200
In Garageband 1.1 the view returned in
- (NSView *) uiViewForAudioUnit: (AudioUnit) au withSize : (NSSize)
inPreferredSize
is send a release message immediately, is that a bug in GarageBand?
and it's also send a release message when the plug is changing.
PS none of the other objects from the nib file is released when the
plug is closed?
Each call to uiViewForAudioUnit:withSize: is expected to return a
unique view.That is to say that the class implementing the
AUCocoaUIBase protocol shouldfunction as a view factory. Each returned
view should have a retain count of 1, and be returned autoreleased. It
is the hosts responsibility to retain the view asnecessary. See the
SampleEffectUnits Cocoa UI in the SDK for an example
- (NSView *)uiViewForAudioUnit:(AudioUnit)inAU
withSize:(NSSize)inPreferredSize {
if (! [NSBundle loadNibNamed: @"SampleEffectUI" owner:self]) {
NSLog (@"Unable to load nib for view.");
return nil;
}
// This particular nib has a fixed size, so we don't do anything
with the inPreferredSize argument.
// It's up to the host application to handle.
[uiFreshlyLoadedView setAU:inAU];
NSView *returnView = uiFreshlyLoadedView;
uiFreshlyLoadedView = nil; // zero out pointer. This is a view
factory. Once a view's been created
// and handed off, the factory keeps no
record of it.
return [returnView autorelease];
}
should the returnView be retained?
If i retain the view, it's working but the view is leaking (all the
subviews are released, if i return [self autorelease] in the init())
Could someone please explain what's is supposed to happen to the view
at the host side.
Peter Mark
Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.