Skip to content

Commit 3f72e9e

Browse files
committed
Only call ObjectSpace.trace_object_allocations_stop when it'ss previouly started
1 parent 30ab116 commit 3f72e9e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/debug/config.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ def update conf
124124
self.class.instance_variable_set(:@config, conf.freeze)
125125

126126
# Post process
127-
if_updated old_conf, conf, :keep_alloc_site do |_, new|
128-
require 'objspace'
127+
if_updated old_conf, conf, :keep_alloc_site do |old, new|
129128
if new
129+
require 'objspace'
130130
ObjectSpace.trace_object_allocations_start
131-
else
131+
end
132+
133+
if old && !new
132134
ObjectSpace.trace_object_allocations_stop
133135
end
134136
end

0 commit comments

Comments
 (0)