lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2010/8/2 Benoit Germain <bgermain@ubisoft.fr>:
> What I would do to solve this is store all lines belonging to a plot in some table, but instead of this being the plot's environment, use your plots as weak keys to these tables in an ephemeron table stored in the registry, thus causing plot finalizers to be called before the lines are destroyed (see §2.5.2).

Hi Benoit, all,

I've used the method you have suggested with a table that uses weak
keys. The referenced graphical objects are stored in this table using
the plot as a key.

Actually the method works very well with the exception of the Lua
termination. If I terminate the Lua top level with ctrl-D
(end-of-file) it seems that the whole machinery fails to ensure the
proper order for finalizers.

Here the output of the program that illustrate the problem:

---------------
GSL Shell, Copyright (C) 2009, 2010 Francesco Abbate
GNU Scientific Library, Copyright (C) The GSL Team
Lua 5.1.4, Copyright (C) 1994-2008 Lua.org, PUC-Rio (complex double int32)
> dofile('examples/plot.lua')
> EXIT

Deallocating path: 00CB8D48
Deallocating path: 00CAD0A8
Deallocating path: 007776F0
Deallocating plot-window: 00CC20B0
pure virtual method called

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
-----------

I hope someone can help me.

Francesco