Comment 26 for bug 804321

Revision history for this message
Archimedes Trajano (trajano) wrote : Re: [Bug 804321] Re: OSX 10.7 with external display causes CPU spike
  • insomniat-3.0.1.dmg Edit (859.1 KiB, application/octet-stream; x-mac-type=64657669; x-mac-creator=6464736B; x-unix-mode=0644; name="insomniat-3.0.1.dmg")

Found the reason for crash on bootup. I added a NULL check in the getMultipleDisplays my suspicion is that getMatchingServices() reutrns NULL on boot up.

     OSDictionary* dict = OSDictionary::withCapacity(1);
     dict->setObject(kIOProviderClassKey, OSString::withCStringNoCopy("IODisplayConnect"));
     OSIterator* ioDisplayConnectIterator = getMatchingServices(dict);
+ if (ioDisplayConnectIterator == NULL) {
+ return false;
+ }
     unsigned int displayCount = 0;
     OSObject* obj;