diff --git a/Source/utils/CGMappings.swift b/Source/utils/CGMappings.swift index 99d2a87f..7eced04e 100644 --- a/Source/utils/CGMappings.swift +++ b/Source/utils/CGMappings.swift @@ -149,6 +149,7 @@ public extension Node { defer { MGraphicsEndImageContext() + renderer.dispose() } guard let img = MGraphicsGetImageFromCurrentImageContext() else { diff --git a/Source/views/MacawView.swift b/Source/views/MacawView.swift index cb1ae1e1..bea76341 100644 --- a/Source/views/MacawView.swift +++ b/Source/views/MacawView.swift @@ -671,6 +671,11 @@ internal class DrawingView: MView { recognizersMap.removeValue(forKey: recognizer) } } + + // MARK: - Cleanup + deinit { + renderer?.dispose() + } } class LayoutHelper {