Permalink
Browse files

Fixed File's deinit

  • Loading branch information...
1 parent 7aea6c5 commit 8aa6d8764e0459d9a60f022fdebb592d2afa2f1d @kjessup kjessup committed Jan 5, 2017
Showing with 4 additions and 0 deletions.
  1. +4 −0 Sources/PerfectLib/File.swift
@@ -137,6 +137,10 @@ public class File {
self.fd = Int(fd)
}
+ deinit {
+ close()
+ }
+
/// Closes the file if it had been opened
public func close() {
if fd != -1 {

0 comments on commit 8aa6d87

Please sign in to comment.