Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing AppleMediaBay (bug report)



Kevin --

>AppleMediaBay's free method calls PMStop. The problem is that PMInit is
>not called in the init method. Instead, it is called in initForPM, which
>in turn is called by the start method. This means that in cases where
>start is never called, PMStop is called without PMInit having ever been
>called. And this is exactly what happens if you subclass AppleMediaBay
>and out-match it. AppleMediaBay gets probed, but not started, and then
>when it is freed PMStop gets called when it shouldn't be.

Shouldn't they simply be calling PMStop in stop instead of free? I thought
the implicit mechanism was that anything you did in start you undo in stop
and anything you do in init you undo in free...

You would think that...However, stop() might be called multiple times. I've seen this behavior when my colleagues and I brought up the SAM stuff and got the power management working. Ryan's suggestion of keeping around a member variable is probably the way to go. And I think it should be done in finalize(), not free(). I believe finalize() is called after you've been tagged inactive on a termination up through the stack.

I'll see that the bug gets assigned to the correct component/person for fixing.

A bug number would help...

-- Chris

------------------
6 Infinite Loop
M/S 306-2MS
Cupertino CA 95014
phone: (408) 974-4033
fax: (408) 862-7577
email: email@hidden
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: Subclassing AppleMediaBay (bug report) (From: Kevin Elliott <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.