Skip to content

Commit b841913

Browse files
author
Piotr Stankiewicz
committed
gpuinfo: Release Metal device handle in VRAM size getter
Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
1 parent 7730970 commit b841913

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/gpuinfo/metal.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
size_t getVRAMSize() {
88
id<MTLDevice> device = MTLCreateSystemDefaultDevice();
99
if (device) {
10-
return [device recommendedMaxWorkingSetSize];
10+
size_t vramsz = [device recommendedMaxWorkingSetSize];
11+
[device release];
12+
return vramsz;
1113
}
1214
return 0;
1315
}

0 commit comments

Comments
 (0)