Do not abort when unlinking non-data ruby objects

Fixes issue #1168.
Remove a call to abort() (introduced by commit
0e725b5d9b) made when SWIG_RubyUnlinkObjects()
is called on non T_DATA objects. It can happen when the destruction of T_DATA
objects is deferred: the Ruby GC first turn them to T_ZOMBIE, then calls their
free method (SWIG_RubyUnlinkObjects()).
This commit is contained in:
Cyrille Faucheux 2017-12-05 21:52:47 +01:00
commit a4884e45e1
2 changed files with 12 additions and 7 deletions

View file

@ -39,7 +39,11 @@ GC.start
# C++ object
ok = false
begin
puts tiger2.get_name
# Let's stress the GC a bit, a single pass might not be enough.
10.times {
GC.start
puts tiger2.get_name
}
rescue ObjectPreviouslyDeleted => error
ok = true
end