Clay
21-03-2008 23:45:56
I've run into a problem... Say you add a FrameListener:
From this frame listener if you to remove itself, you get a NullReferenceException. Here is the code:
This gives a NullReferenceException with this callstack:
Marioko, could you take a look at this? I can't quite tell what the problem is from looking at the C++/CLI code.
Thanks,
-Clay
root.FrameStarted += new FrameListener.FrameStartedHandler(TestListener);
From this frame listener if you to remove itself, you get a NullReferenceException. Here is the code:
static bool TestListener(FrameEvent evt)
{
Mogre.Root.Singleton.FrameStarted -= new FrameListener.FrameStartedHandler(TestListener);
return true;
}
This gives a NullReferenceException with this callstack:
at Mogre.Root.remove_FrameStarted(FrameStartedHandler hnd)
at MogrePython.Program.TestListener(FrameEvent evt) in C:\Users\clay\Documents\Visual Studio 2008\Projects\MogrePython\MogrePython\Program.cs:line 34
at Mogre.Root.raise_FrameStarted(FrameEvent evt)
at Mogre.Root.OnFrameStarted(FrameEvent evt)
at Mogre.FrameListener_Director.frameStarted(FrameListener_Director* , FrameEvent* evt)
at Ogre.Root.renderOneFrame(Root* )
at Mogre.Root.RenderOneFrame()
at MogrePython.OgreWindow.Go() in C:\Users\clay\Documents\Visual Studio 2008\Projects\MogrePython\MogrePython\OgreWindow.cs:line 81
at MogrePython.Program.Main() in C:\Users\clay\Documents\Visual Studio 2008\Projects\MogrePython\MogrePython\Program.cs:line 21
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Marioko, could you take a look at this? I can't quite tell what the problem is from looking at the C++/CLI code.
Thanks,
-Clay