mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-21 17:34:42 +03:00
fix: wrap BackingScaleFactor in autoreleasepool to stop NSDictionary accumulation on macOS (#15623)
Signed-off-by: Viktor Kuksgauzen <vkpiar@gmail.com>
This commit is contained in:
@@ -118,6 +118,7 @@ extern "C" bool MacCheckAdminAuthorization() {
|
|||||||
|
|
||||||
// https://gist.github.com/briankc/025415e25900750f402235dbf1b74e42
|
// https://gist.github.com/briankc/025415e25900750f402235dbf1b74e42
|
||||||
extern "C" float BackingScaleFactor(uint32_t display) {
|
extern "C" float BackingScaleFactor(uint32_t display) {
|
||||||
|
@autoreleasepool {
|
||||||
NSArray<NSScreen *> *screens = [NSScreen screens];
|
NSArray<NSScreen *> *screens = [NSScreen screens];
|
||||||
for (NSScreen *screen in screens) {
|
for (NSScreen *screen in screens) {
|
||||||
NSDictionary *deviceDescription = [screen deviceDescription];
|
NSDictionary *deviceDescription = [screen deviceDescription];
|
||||||
@@ -128,6 +129,7 @@ extern "C" float BackingScaleFactor(uint32_t display) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/jhford/screenresolution/blob/master/cg_utils.c
|
// https://github.com/jhford/screenresolution/blob/master/cg_utils.c
|
||||||
|
|||||||
Reference in New Issue
Block a user