Skip to content

Commit

Permalink
Merge pull request #1 from mamitech/optimize-memory
Browse files Browse the repository at this point in the history
optimize memory leak
  • Loading branch information
rwpramono-mamiteam authored Dec 17, 2021
2 parents 57a98af + bcb3f93 commit 6597e85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/utils/CGMappings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public extension Node {

defer {
MGraphicsEndImageContext()
renderer.dispose()
}

guard let img = MGraphicsGetImageFromCurrentImageContext() else {
Expand Down
5 changes: 5 additions & 0 deletions Source/views/MacawView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,11 @@ internal class DrawingView: MView {
recognizersMap.removeValue(forKey: recognizer)
}
}

// MARK: - Cleanup
deinit {
renderer?.dispose()
}
}

class LayoutHelper {
Expand Down

0 comments on commit 6597e85

Please sign in to comment.