MOGRE doesn't seem to exit properly.

baconfish

26-06-2008 01:08:18

I'm trying to get started with MOGRE in Visual C# 2008 Express Edition and things are going sort-of-alright-I-guess right up until the end of the program.

My code is a direct copy of the code from the MOGRE wiki basic tutorial 5:
http://www.ogre3d.org/wiki/index.php/Mogre_Basic_Tutorial_5_Source

It'll pop up a window, show the ninja model for 5 seconds, then exit. But when it *does* exit Visual C# throws an AccessViolationException in my face:
{"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}
And the stack trace says:
" at Ogre.Root.{dtor}(Root* )\r\n at Mogre.Root.!Root()\r\n at Mogre.Root.Dispose(Boolean )\r\n at Mogre.Root.Finalize()"
I didn't have any problems running the included samples.

I think I saw something in the ExampleApplication about catching a certain exception but I'm actually more interested in why this is happening in the first place and whether or not it can actually be fixed.

baconfish

26-06-2008 15:23:32

Oh hey.

I thought maybe I messed something up when I was trying to get other shit working so I made a new project and tried again. Same thing, except at the end I get an Open File dialog asking me where to find mogreroot.h, and the default location is:
d:\cubicalminds\mogreworld\mogre\mogre\include\auto\mogreroot.h

Sup, Marioko?

baconfish

26-06-2008 17:57:49

Apparently all it takes is to make sure you call Dispose on your Root object. Not really what I was expecting considering the garbage collection and that the tutorial didn't mention it at all. I think I might just go make some edits if nobody minds.