I have an extention for mzscheme in C++.<br><br>This is how my code looks like:<br><br>struct Widget<br>{<br> Scheme_Object* callback;<br> <br> Widget() : callback(scheme_null) { }<br>};<br><br><br>Scheme_Object* callback(int argc, Scheme_Object** argv)<br>
{<br> Widget* w = new Widget;<br> w->callback = argv[0];<br> return scheme_true;<br>}<br><br>argv[0] is a procedure assigned from scheme code.<br>This is getting garbage collected when i call (collect-garbage) even though a reference is held in w->callback.<br>
I want to tell the GC about this reference.<br>scheme_dont_gc_ptr(argv[0]) did not help.<br><br>thanks,<br><br> -- Vijay<br>