Skip to content

Commit

Permalink
Fix memory leak of framework wrappers (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
tishin authored Nov 14, 2023
1 parent adab179 commit 92e1453
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/SwiftGodot/Core/Wrapped.swift
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@ func frameworkTypeBindingFree (_ token: UnsafeMutableRawPointer?, _ instance: Un
print ("SWIFT ERROR: attempt to release framework object we were not aware of: \(String(describing: instance))")
}
}

if let binding {
Unmanaged<Wrapped>.fromOpaque(binding).release()
}
}

func frameworkTypeBindingReference(_ x: UnsafeMutableRawPointer?, _ y: UnsafeMutableRawPointer?, _ z: UInt8) -> UInt8 {
Expand Down

0 comments on commit 92e1453

Please sign in to comment.