8000 Release some unreleased objects in the macosx backend · jdgd1/matplotlib@0d775a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d775a4

Browse files
committed
Release some unreleased objects in the macosx backend
1 parent dbb80f4 commit 0d775a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/_macosx.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ static int wait_for_stdin(void)
203203
if (interrupted) raise(SIGINT);
204204
}
205205
CFReadStreamClose(stream);
206+
CFRelease(stream);
206207
return 1;
207208
}
208209

@@ -2103,6 +2104,7 @@ static int _find_maximum(CGFloat values[3])
21032104
function,
21042105
true,
21052106
true);
2107+
CGColorSpaceRelease(colorspace);
21062108
CGFunctionRelease(function);
21072109
if (shading)
21082110
{
@@ -2236,6 +2238,7 @@ static CGRect _find_enclosing_rect(CGPoint points[3])
22362238
CGImageRef mask = CGBitmapContextCreateImage(bitmap);
22372239
CGContextClipToMask(cr, rect, mask);
22382240
CGImageRelease(mask);
2241+
CGContextRelease(bitmap);
22392242
free(data);
22402243
return 0;
22412244
}
@@ -3990,9 +3993,9 @@ static void _data_provider_release(void* info, const void* data, size_t size)
39903993
if(window)
39913994
{
39923995
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
3993-
NSString* ns_title = [[NSString alloc]
3994-
initWithCString: title
3995-
encoding: NSUTF8StringEncoding];
3996+
NSString* ns_title = [[[NSString alloc]
3997+
initWithCString: title
3998+
encoding: NSUTF8StringEncoding] autorelease];
39963999
[window setTitle: ns_title];
39974000
[pool release];
39984001
}

0 commit comments

Comments
 (0)
0