Game Development Community

Not complete close on Game.Instance.Exit()

by Heine Gundersen · in Torque X 2D · 08/01/2007 (4:36 am) · 9 replies

I'm having a few problems regarding closing off a torqueX application completly (Window disapperes but application doesn't terminate completly when running in from GameStudio).

I have a GUI statemachine and an level statemachine as a basis for the game. Whenever I load a level I assign a new folder for all level created content to delete it all afterwards.

if (_levelFolder == null)
{
_levelFolder = new TorqueFolder();
_levelFolder.Name = "Level folder";
TorqueObjectDatabase.Instance.Register(_levelFolder);
TorqueObjectDatabase.Instance.CurrentFolder = _levelFolder;
}

When I exit the level I remove it automatically.

if (_levelFolder != null && _levelFolder.IsRegistered)
{
TorqueObjectDatabase.Instance.Unregister(_levelFolder);
_levelFolder = null;
}

The only thing I can think off is some process is still running, but I can't seam to find out which. I DO use the TorqueEngineComponent.Instance.GameTimeSchedule.Schedule for timing in the levels.

Please help :)

About the author

Recent Threads


#1
08/01/2007 (4:39 am)
Forgot to mention. It's very periodic - Some times the application exits fine, sometimes not at all.
#2
08/01/2007 (3:07 pm)
The same thing is happening to me and I haven't looked into why yet but I admit it has been quite annoying.
#3
08/01/2007 (3:33 pm)
I've actually noticed this on my x64 machine when using sounds. It had something to do with the sounds not finalizing soon enough or something, but that issue was supposed to be fixed. I don't know if this is related or not. Where is it hanging exactly?

Edit: Doh.. you wouldn't be able to tell us without source. Do either of you have Pro?
#4
08/01/2007 (6:48 pm)
No, but I'll take a free copy for debugging purposes. ;)
#5
08/02/2007 (2:24 am)
No affraid not. Using the XNA creators version.

I'm currently developing using a x64 at home. I've only experienced the crashes on that. I havn't experienced it on my laptop.. yet :)
#6
08/09/2007 (7:02 pm)
Well, I now have TorqueX Pro and here's where it's hanging:

TorqueEngineComponent.cs
public void ShutdownAudio()
        {
            if (_sfxDevice != null)
            {
                if (!_sfxDevice.IsDisposed)
                    [b]_sfxDevice.Dispose();[/b] // <----------------------
                _sfxDevice = null;
            }
        }
#7
08/16/2007 (6:43 pm)
Deleted the post asking if you were using an x64 machine.. I should have read more carefully.

Anyway, it seems to be isolated to x64. I have no idea what could be causing it. We thought, at one point, that it had to do with the sfx device not being disposed of soon enough. Either way, this seems to be an XNA issue. Hopefully they addressed it in 2.0.
#8
08/16/2007 (6:53 pm)
Either that, or we're going to have to organize a pantless invasion of the Microsoft XNA offices.
#9
08/16/2007 (10:28 pm)
I'm in!