From: "Asbjørn Reglund Thorsen" Date: 2005-01-15T22:05:58+09:00 Subject: [n00b] C++ extensions, GC, Ruby and SWIG ---259931839-1996686507-1105794351=:19693 Content-Type: MULTIPART/MIXED; BOUNDARY="-259931839-1996686507-1105794351=:19693" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---259931839-1996686507-1105794351=:19693 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE I`m having trouble with an interface to a c++ library. It seems like=20 Ruby`s GC is collecting objects that it shouldn`t. I have read the=20 SWIG-Ruby documentation on the matter, but I am unsure of where to put the markfunc= =20 , and how to get it to interact with my program. My interface file : mHeat1.i My Ruby code : run.rb require 'mHeat1' menu =3D MHeat1::MenuSystem.new menu.init("Ruby Interface", "This is so cool !") heat =3D MHeat1::Heat1.new heat.define(menu) heat.scan heat.solveProblem heat.resultReport The problem is the MenuSystem, I found out by using gdb: gdb ruby (gdb)run run.rb =2E.. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 1345)] 0x00000089 in ?? () (gdb) where #0 0x00000089 in ?? () #1 0x40388c19 in free_MenuSystem () from ./mHeat1.so #2 0x0806f636 in rb_gc_call_finalizer_at_exit () at gc.c:1858 #3 0x08053e34 in ruby_finalize_1 () at eval.c:1418 #4 0x08053f43 in ruby_cleanup (ex=3D0) at eval.c:1453 #5 0x08054081 in ruby_stop (ex=3D135573240) at eval.c:1484 #6 0x080540ef in ruby_run () at eval.c:1505 #7 0x08052245 in main (argc=3D135573240, argv=3D0x814aef8, envp=3D0xbffff0= 20) at main.c:46 Is it possible to use the %marcfunc directive in this case ? And how ? I am a n00b at this, so I`d really like some help/tips. ---259931839-1996686507-1105794351=:19693-- ---259931839-1996686507-1105794351=:19693--