Skip to content

Commit

Permalink
Fix $LOAD_PATH.dup to be Ractor shareable
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Oct 27, 2023
1 parent c4fb919 commit 3e65ac9
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 3e65ac9

Please sign in to comment.