Skip to content

Commit

Permalink
fix: get project building with new Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
acheronfail committed Oct 20, 2021
1 parent fae133c commit fae137a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Pixel Picker/CGImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ extension CGImage {

// Since we manually allocate memeory for the data, we must ensure that the same memory is
// freed after we've used it.
defer { free(bitmapData) }
defer {
if let ptr = bitmapData {
free(ptr)
}
}

// Create the bitmap context.
let context = CGContext(
Expand Down

0 comments on commit fae137a

Please sign in to comment.