Part 1... However, a subsequent call to ivars->fResponseMap->GetAddress() returns NULL (0x0). Subsequent call when? The expectation (and what our driver does) is that you'd immediately call GetAddress() and then basically never look at the map again. In one of our drivers, that never is quite literal. The code is basically: IOMemoryMap *memoryMap = NULL; if ( parallelCommandIOMemoryDescriptor->CreateMapping(0, 0, 0, 0, 0, &memoryMap) == kIOReturnSuccess ) { ivars->fCommandAddress = memoryMap->GetAddress(); } ... if ( parallelResponseIOMemoryDescriptor->CreateMapping(0, 0, 0, 0, 0, &memoryMap) == kIOReturnSuccess ) { ivars->fParallelResponseAddress = memoryMap->GetAddress(); } ...and, yes, that code leaks two IOMemoryMap's. I don't know what the exact thinking was, but I suspect they realized that the only reason that mapping would ever become invalid/useless was because the driver was being torn down, so freeing doesn't really matter. I'll admit, there is a certain charm to tha
Topic:
App & System Services
SubTopic:
Drivers
Tags: