Erik Hofman writes:
>
> Norman Vine wrote:
>
> > but FGFS still won't exit with out a 'ctrl-c' or other forced
> > sig quit with the existing static FGTileManager whereas
> > it exits with a dynamically allocated one that automagically
> > calls its destructor at exit time
>
> I can't check this one myself because the new ATC code needs some more
> attention fro IRIX, but could you give this patch a try?
> In theory it should work, but ...
> inline
> SGThread::~SGThread()
> {
> + // Make sure the thread is cancelled at exit.
> + pthread_kill(tid, SIGKILL);
> }
Good try but ...
This should work with Cygwin but it won't work with native Win32
because native Win32 does not implement signals.
I think the easiest way todo this portably is to rely on the C++ 'dtor'
to bring the threads down. i.e if the threads 'belong' to an allocated
class then when the class destructor is called the thread will be destoyed.
This seems to work well with both Cygwin and MingW32
and I see no reason why it shouldn't just work everywhere
Also allocating the tile_manager(s) rather then having one global one
is probably a good idea too in that it will allow us to have a different
tile_manager for different locations.
i.e static FGLocations like the tower_view could have their own set of
tiles then.
This is potentially a more efficient approach and would solve some of
the problems assosciated in controlling more then one FDM within a
single instance of FGFS.
Cheers
Norman
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel