Skip to content

Commit

Permalink
Added stub for autoreleasepool on linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed Apr 23, 2024
1 parent e1bc5f6 commit 0f3b18c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Segment/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ extension DispatchQueue {
workItem.wait()
}
}

// Linux doesn't have autoreleasepool.
func autoreleasepool(closure: () -> Void) {
closure()
}
#endif

/// Inquire as to whether we are within a Unit Testing environment.
Expand Down Expand Up @@ -84,4 +89,3 @@ internal func eventStorageDirectory(writeKey: String) -> URL {
try? FileManager.default.createDirectory(at: segmentURL, withIntermediateDirectories: true, attributes: nil)
return segmentURL
}

0 comments on commit 0f3b18c

Please sign in to comment.