Skip to content

Commit

Permalink
Merge pull request #455 from Bo98/load_path-dup-fix
Browse files Browse the repository at this point in the history
Fix $LOAD_PATH.dup to be Ractor shareable
  • Loading branch information
casperisfine authored Oct 30, 2023
2 parents 02e1a6f + 3e65ac9 commit 31cd669
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/bootsnap/load_path_cache/change_observer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ def uniq!(*args)
ret
end
end

def dup
new_obj = super
new_obj.remove_instance_variable(:@lpc_observer)
new_obj
end

def clone
new_obj = super
ChangeObserver.unregister(new_obj)
new_obj
end
end

def self.register(arr, observer)
Expand Down

0 comments on commit 31cd669

Please sign in to comment.