Skip to content

Commit

Permalink
fixed deallocate method
Browse files Browse the repository at this point in the history
  • Loading branch information
soundflix authored Mar 5, 2023
1 parent 1573cc2 commit ad0055b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ZMAX/Sources/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ extension AXValue {
public func toValue<T>() -> T? {
let pointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
defer {
pointer.deallocate(capacity: 1)
pointer.deallocate()
}
let success = AXValueGetValue(self, AXValueGetType(self), pointer)
return success ? pointer.pointee : nil
Expand All @@ -220,7 +220,7 @@ extension AXValue {
public static func from<T>(value: T, type: AXValueType) -> AXValue? {
let pointer = UnsafeMutablePointer<T>.allocate(capacity: 1)
defer {
pointer.deallocate(capacity: 1)
pointer.deallocate()
}
pointer.pointee = value
return AXValueCreate(type, pointer)
Expand Down

0 comments on commit ad0055b

Please sign in to comment.