Skip to content

Commit

Permalink
Fix memory leak for macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
ooba committed Oct 11, 2018
1 parent 477999e commit 60a6ffe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Source/Charts/Utils/Platform+Accessibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ internal func accessibilityPostScreenChangedNotification(withElement element: An
/// A simple abstraction over UIAccessibilityElement and NSAccessibilityElement.
open class NSUIAccessibilityElement: NSAccessibilityElement
{
private let containerView: NSView
private weak var containerView: NSView?

final var isHeader: Bool = false
{
Expand Down Expand Up @@ -145,6 +145,10 @@ open class NSUIAccessibilityElement: NSAccessibilityElement

set
{
guard let containerView = containerView else {
return
}

let bounds = NSAccessibility.screenRect(fromView: containerView, rect: newValue)

// This works, but won't auto update if the window is resized or moved.
Expand Down

2 comments on commit 60a6ffe

@dimpiax
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YusukeOba hello, could you describe in details where data leak was?

@YusukeOba
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.