From: "Jesús Gabriel y Galán" Date: 2011-08-03T16:59:25+09:00 Subject: Re: Help in Pointer On Wed, Aug 3, 2011 at 9:45 AM, Hans Mackowiak wrote: >>Data_Wrap_Struct(klass, mark, free, ptr) > > > if you use > Data_Wrap_Struct(klass, 0, free, ptr) > or > Data_Wrap_Struct(klass, 0, -1, ptr) > > the pointer and the data will be freed > if you use > Data_Wrap_Struct(klass, 0, 0, ptr) > the pointer will not be deleted or freed > > > the problem is: sometimes its bad if the GC deleted objects if there are > stored in other c(++) objects (like an window manager which holds the > windows) this way you need Data_Wrap_Struct(klass, 0, 0, ptr) > > > PS: i does not realy know that mark do, so i does not use it If I understand correctly, you have to use the mark function if you are referencing other Ruby objects from your object, so that the GC knows those objects are alive, since they are referenced from yours. Jesus.