⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 288074 in webkit


Ignore:
Timestamp:
Jan 16, 2022, 1:34:17 PM (5 years ago)
Author:
ddkilzer@apple.com
Message:

REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called
<​https://webkit.org/b/235278>
<rdar://problem/87653812>

Reviewed by Darin Adler.

  • src/libANGLE/renderer/metal/DisplayMtl.mm:

(rx::DisplayMtl::getMetalDeviceMatchingAttribute):

  • Make use of mtl::adoptObjCObj<> so these objects are relaseed when the method returns.
Location:
trunk/Source/ThirdParty/ANGLE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/ANGLE/ChangeLog

    r288041 r288074  
     12022-01-16  David Kilzer  <ddkilzer@apple.com>
     2
     3        REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called
     4        <https://webkit.org/b/235278>
     5        <rdar://problem/87653812>
     6
     7        Reviewed by Darin Adler.
     8
     9        * src/libANGLE/renderer/metal/DisplayMtl.mm:
     10        (rx::DisplayMtl::getMetalDeviceMatchingAttribute):
     11        - Make use of mtl::adoptObjCObj<> so these objects are relaseed
     12          when the method returns.
     13
    1142022-01-14  Kyle Piddington  <kpiddington@apple.com>
    215
  • trunk/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm

    r288041 r288074  
    239239    auto deviceList = mtl::adoptObjCObj(MTLCopyAllDevices());
    240240
    241     NSMutableArray<id<MTLDevice>> *externalGPUs   = [[NSMutableArray alloc] init];
    242     NSMutableArray<id<MTLDevice>> *integratedGPUs = [[NSMutableArray alloc] init];
    243     NSMutableArray<id<MTLDevice>> *discreteGPUs   = [[NSMutableArray alloc] init];
     241    auto externalGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]);
     242    auto integratedGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]);
     243    auto discreteGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]);
    244244    for (id<MTLDevice> device in deviceList.get())
    245245    {
    246246        if (device.removable)
    247247        {
    248             [externalGPUs addObject:device];
     248            [externalGPUs.get() addObject:device];
    249249        }
    250250        else if (device.lowPower)
    251251        {
    252             [integratedGPUs addObject:device];
     252            [integratedGPUs.get() addObject:device];
    253253        }
    254254        else
    255255        {
    256             [discreteGPUs addObject:device];
     256            [discreteGPUs.get() addObject:device];
    257257        }
    258258    }
    … …  
    263263    {
    264264        // Search for a discrete GPU first.
    265         for (id<MTLDevice> device in discreteGPUs)
     265        for (id<MTLDevice> device in discreteGPUs.get())
    266266        {
    267267            if (![device isHeadless])
    … …  
    272272    {
    273273        // If we've selected a low power device, look through integrated devices.
    274         for (id<MTLDevice> device in integratedGPUs)
     274        for (id<MTLDevice> device in integratedGPUs.get())
    275275        {
    276276            if (![device isHeadless])
    … …  
    296296
    297297    // Default to use a low power device, look through integrated devices.
    298     for (id<MTLDevice> device in integratedGPUs)
     298    for (id<MTLDevice> device in integratedGPUs.get())
    299299    {
    300300        if (![device isHeadless])
Note: See TracChangeset for help on using the changeset viewer.