From: Eric Hodel Date: 2011-02-09T07:43:55+09:00 Subject: Re: C extension: How to check if a VALUE is still alive (not being GC'ed)? On Feb 8, 2011, at 12:53 AM, Iņaki Baz Castillo wrote: > 2011/2/8 Tony Arcieri : >>> After rechecking it I strongly think I must store the object "query" >>> in a Hash. If not, the object clearly "dissapears" and could be >>> legitimately GC'ed at any time. >> >> I'd think the resolver object would hold on to all active queries until >> completed. > > Yes, that's work: the resolver object contains a hash attribute in > which queries are stored until completed. Use a ruby hash and supply mark and GC callbacks to Data_Wrap_Struct so the GC will keep track of it.