Hi Gerit,
Gerrit Voss wrote:
> On Sat, 2008-11-22 at 17:24 -0600, Carsten Neumann wrote:
>> Marcus Lindblom wrote:
>>> Carsten Neumann wrote:
>>>> alright, on windows (vs 2008 express) I can reproduce it (r1577).
>>>> BTW is there a way to start the debugger from a command line (similar
>>>> like doing gdb ./testSimpleSceneManager)? It is a bit painful having to
>>>> create a new project and coax it into debugging an existing program that
>>>> it did not really build itself.
>>> Yup .. Do 'devenv /?' and see the options,
>> Thanks for the tip, but I don't think I have that program.
>>
>>> alternatively you can do
>>> 'attach to process' from the debug menu in the IDE. I think you also can
>>> create an empty project and enter 'testsimplescenemanager' in the debug
>>> settings on the project then just start it in debug mode (i.e. F5).
>> that is sort of what I'm doing, but it requires that I set up the
>> environment to find libs in the IDE, instead of just using the
>> environment on my command line. Hopefully this was a one time process
>> now that I've gone though it ;)
>
> this is strange, I'm pretty sure starting devenv from cygwin takes the
> correct settings from there (at least the non express versions do).
I did not realize that devenv is the name of the IDE executable (it's
different for the express edition). Should be ok now, thanks for the
pointers.
>> I'm still wondering if the order of d'tors for global static objects and
>> atexit handlers is different (and probably implementation
>> defined/undefined so we should not rely on it anyways) ?
>
> 3.6.3 Termination / 3 solves the mystery:
>
> If a function is registered with atexit (see <cstdlib>, 18.3) then
> following the call to exit, any objects with static storage duration
> initialized prior to the registration of that function shall not be
> destroyed until the registered function is called from the termination
> process and has completed. For an object with static storage duration
> constructed after a function is registered with atexit, then following
> the call to exit, the registered function is not called until the
> execution of the object’s destructor has completed. If atexit is called
> during the construction of an object, the complete object to which it
> belongs shall be destroyed before the registered function is called.
thanks for looking this up. Do you know if this is implemented correctly
on the different platforms ?
From what i've seen this means that _defaultMaterial (the pointer
itself not the pointed-to material) is constructed after osgInit runs
and therefore destroyed before osgExit runs (as an atexit handler).
>> Anybody got a good idea ?
>
> The above says basically our use of atexit is wrong. I'm fine with going
> back to explicit osgExit calls (I do that anyway).
If there is no way to make the exit handler thing work reliably, this is
fine for me.
> The other option
> is to register a callback that removes subRefDefaultMaterial from the
> pre factory exit functions.
ok, but we only need to do that if the smart pointer object
_defaultMaterial is constructed after osgInit runs (and registers
osgExit as atexit handler). If the user calls osgExit or the pointer is
constructed before osgInit we are fine. Is there a way to force the
construction to happen early ? (What triggers the construction anyways ?)
Thanks,
Carsten
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users