mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +00:00
Ladybird: Ensure we release CoreFoundation references
Once we are done with our references to some CoreFoundation types, we must be sure to manually release those references.
This commit is contained in:
parent
2d154bf90a
commit
4f563e346d
|
@ -89,6 +89,7 @@ bool CFEventLoopManager::unregister_timer(int timer_id)
|
|||
|
||||
if (auto timer = thread_data.timers.take(timer_id); timer.has_value()) {
|
||||
CFRunLoopTimerInvalidate(*timer);
|
||||
CFRelease(*timer);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -140,6 +141,8 @@ void CFEventLoopManager::register_notifier(Core::Notifier& notifier)
|
|||
auto* source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
|
||||
|
||||
CFRelease(socket);
|
||||
|
||||
ThreadData::the().notifiers.set(¬ifier, source);
|
||||
}
|
||||
|
||||
|
|
|
@ -860,6 +860,7 @@ static void copy_text_to_clipboard(StringView text)
|
|||
[image drawInRect:image_rect];
|
||||
|
||||
CGContextRestoreGState(context);
|
||||
CGDataProviderRelease(provider);
|
||||
CGImageRelease(bitmap_image);
|
||||
|
||||
[super drawRect:rect];
|
||||
|
|
Loading…
Reference in a new issue