newbie wrote: > Hi, all > I am integrating a 3rd party API with ruby extension. The code is > roughly like this > void my_function() > { > char p[256]; > ...//assign the value of p in the api > > return rb_str_new2(p);//This cause a crash. > } > while if I change the last part a little bit as, > VALUE str=rb_str_new2(p); > return str; > This seems not crashing > > It looks like more related to ruby GC? Can anyone explain on this? and > how to prevent this kind of crash? > > Thanks! > I guess changing: > void my_function() to: VALUE my_function() might help (?) daz