Hi everyone,

just a simple request stil on the introspection framework:

I have noticed that the Types and Converters are stored in a static
structure in the Reflection class... and this structure is totally
unaccessible. (Well we could still use Reflection::getTypes() to get the
type map and delete every type one by one after a const cast,  but for the
converters map that's not possible.

The problem with this kind of static structure, is that they are destroyed
only at the very end of your process, and when it comes to profiling
questions this gives a big mess (at least on Windows...) : My profiler
(AQTime 5) is simply considering all the reflection allocations as memory
leaks !...

I guess it would not be a bad idea to add a simple "clear" static function
to the reflection class to simply delete the static_data member and set it
to NULL. This could even prove useful in [I admit very specific and very
strange] cases where people would want to stop reflecting every types and
restart with new types...

Could some one remind me how to process to submit a code change ? (except if
someone else can add this "clear" or whatever function directly... it should
only be two lines of code anyway:

void clear() {
  if(_static_data)
      delete _static_data;
  _static_data = 0;
}

regards,

Manu.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to