OOP leaking with registered object

Roland Plüss <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.gnu.general
Message-ID <[email protected]>
I'm trying to figure out why I've got a leak with GST. It's about a C++
program hosting smalltalk as script language. Let's say you've got this
scenario:

class Something:
   OOP app
   Init():
      gst_initialize( NULL, NULL, GST_NO_TTY )
      // add classes and stuff
      app = gst_perform( classApp, selectorNew ) // calls also init
      gst_register_oop( app );
   CleanUp():
      app = gst_perform( classApp, selectorCleanup ) // calls cleanup
      gst_unregister_oop( app );
      // clean up classes and stugg
      gst_invoke_hook( GST_ABOUT_TO_QUIT )

Furthermore let's say a smalltalk script does something simple like this:
MyApp subclass: App [
   | x |
   init [ x := CEnabledClass new ]
   cleanup [ x := nil ]

No other object stores a reference to x for this simple test. Now x is
always leaking. Furthermore OOP app is leaking (if I set it to call
finalize and printf on finalize[] nothing happens).

I can verify that if X is created somewhere in smalltalk function and
going out of scope it is properly destroyed if not used and does not leak.

If assigned to OOP app x leaks because OOP app is not freed. Most
probably OOP app is simply not garbage collected in that short time?

Is there a way to force garbage collection before shutting down?

-- 
Yours sincerely
Plüss Roland

Leader and Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- As well as various Blender export scripts und game tools

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
signature.asc (application/pgp-signature, 181 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlUe6lQACgkQjKGu9ysRWfq7bQCeKwv2bybIntBmvArTHUzI1Alb
gn4An0H+t3mTjtA7PnBT1fV9I1/STN4L
=G9CX
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.