Skip to content

Commit

Permalink
Monkey patch GD2::AnimatedGif to fix the finalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Aug 14, 2024
1 parent 735a5cf commit 390d49d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions config/initializers/gd2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module OpenStreetMap
module GD2
module AnimatedGif
def frames_finalizer
proc do
@frames.each do |frame|
::GD2::GD2FFI.send(:gdFree, frame.ptr)
end
end
end
end
end
end

GD2::AnimatedGif.prepend(OpenStreetMap::GD2::AnimatedGif)

0 comments on commit 390d49d

Please sign in to comment.