-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CandleStickView Memory leak #1100
Comments
@danielgindi any ideas? I used to see it once, and I'm gussing it's swift bug or something else, no clue. |
Did you check for leaks after closing the viewcontroller, or while viewing the charts?.. |
If the ChartDataEntry is created in Swift,the leaks won't appear. |
Finally ,I solved this by changing public init(yVals: [ChartDataEntry]?, label: String?)
{
super.init(label: label)
_yVals = yVals == nil ? [ChartDataEntry]() : yVals
self.calcMinMax(start: _lastStart, end: _lastEnd)
} to public init(yVals: [ChartDataEntry]?, label: String?)
{
super.init(label: label)
if yVals == nil {
_yVals = [ChartDataEntry]()
}else{
let yVals_forbug: [ChartDataEntry] = yVals!
_yVals = yVals_forbug.map({$0})
}
self.calcMinMax(start: _lastStart, end: _lastEnd)
} It's not elegant,but it works. |
Wow that's a nasty bug. We need to report this to Apple |
I will raise issue today while I am in debugging lab of WWDC. Stay tuned |
well I have asked, we investigated into the object, and we found there is a free() eventually, so looks like not a leak, but a leak detector issue... |
I asked a debugging expert today, he confirmed that's should be a swift bug, he said the data set pointer to the array is not looks like a pointer, but the object is there, so it report leaks. I filed a bug for this. Jesus I saw dark magic today.
|
Hello, I know this is a closed issue, but I was hoping one of you could confirm that I have the same issue and can safely ignore the reported leaks for now. For example, in my project I do
Instruments reports me leaks here and I could pinpoint it to the same Sorry, but I'm a little paranoid in this regard, since I'm not that experienced with Instruments (usually it allowed me to easily see the mess I made myself and I was done with it, never had to rely on it extensively...). |
I'm just using the demo. Is it caused by the swift-Objc bridging? Thanks for replying
The text was updated successfully, but these errors were encountered: