summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-07-09 17:23:29 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-07-09 17:23:29 (GMT)
commitd6c477519867f05c985cc5083ab0ad77ea69e453 (patch)
tree393fe87f212bded9009f45bffbce22ea0145f59a /macosx
parent95cc503d0336b3bdd6adef07ba70b9da3cc57c47 (diff)
downloadtk-d6c477519867f05c985cc5083ab0ad77ea69e453.zip
tk-d6c477519867f05c985cc5083ab0ad77ea69e453.tar.gz
tk-d6c477519867f05c985cc5083ab0ad77ea69e453.tar.bz2
Fix [a526d42999]: Aqua: leak in TkpOpenDisplay(). Patch from Christopher Chavez.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXColor.c10
-rw-r--r--macosx/tkMacOSXXStubs.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index a456a19..7e7a81f 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -410,6 +410,11 @@ SetCGColorComponents(
{
CGFloat rgba[4] = {0, 0, 0, 1};
+ if (entry->type == HIBrush) {
+ OSStatus err = ChkErr(HIThemeBrushCreateCGColor, entry->value, c);
+ return err == noErr;
+ }
+
/*
* This function is called before our autorelease pool is set up,
* so it needs its own pool.
@@ -417,11 +422,6 @@ SetCGColorComponents(
NSAutoreleasePool *pool = [NSAutoreleasePool new];
- if (entry->type == HIBrush) {
- OSStatus err = ChkErr(HIThemeBrushCreateCGColor, entry->value, c);
- [pool drain];
- return err == noErr;
- }
GetRGBA(entry, pixel, rgba);
*c = CGColorCreate(sRGB.CGColorSpace, rgba);
[pool drain];
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index d70b913..1973f5d 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -192,7 +192,6 @@ TkpOpenDisplay(
static NSRect maxBounds = {{0, 0}, {0, 0}};
static char vendor[25] = "";
NSArray *cgVers;
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
if (gMacDisplay != NULL) {
if (strcmp(DisplayString(gMacDisplay->display), display_name) == 0) {
@@ -202,6 +201,7 @@ TkpOpenDisplay(
}
}
+ NSAutoreleasePool *pool = [NSAutoreleasePool new];
display = (Display *)ckalloc(sizeof(Display));
screen = (Screen *)ckalloc(sizeof(Screen));
bzero(display, sizeof(Display));