mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +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
Notes:
sideshowbarker
2024-07-17 18:06:52 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/4f563e346d Pull-request: https://github.com/SerenityOS/serenity/pull/20728
2 changed files with 4 additions and 0 deletions
|
@ -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