System.AccessViolationException on exit when using OpenGL

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Silicon
Posts: 2
Joined: Sun Oct 02, 2005 7:02 pm
Location: Colorado, USA

System.AccessViolationException on exit when using OpenGL

Post by Silicon »

I'm using the Irrlicht.NET 0.12 wrapper, I see a System.AccessViolationException when using OpenGL 1.5 as the video driver.

I'm using the VS2005 Express beta, so my code is being compiled and run under .NET v2.0, if that might effect something.

I've pared down the code to a minimum -- I'm just initializing, Run(), BeginScene(), EndScene(). When I click the window's close button, the code runs through to the end of my Main() method, and then the exception is thrown durring the GC's cleanup of the IrrlichtDevice. If I'm missing something I should be doing myself for cleanup, I dont know what it is.

Here's the exeption, as it prints to the console:
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at irr.IUnknown.drop(IUnknown* )
at Irrlicht.IrrlichtDevice.Finalize()
Guest

had the same problem

Post by Guest »

i'm using Visual Studio .net enterprise 2003 architec, and using the example souce code i get two exception:

Code: Select all

An unhandled exception of type 'System.NullReferenceException' occurred in irrlicht.net.dll

Additional information: Object reference not set to an instance of an object.

An unhandled exception of type 'System.NullReferenceException' occurred in irrlicht.net.dll

Additional information: Object reference not set to an instance of an object.
i putted the two dll files on the exec dir...
any clue?
Guest

Post by Guest »

I'm using the VS2005 Express beta, so my code is being compiled and run under .NET v2.0, if that might effect something
Bingo.
Raibaz
Posts: 4
Joined: Mon Oct 17, 2005 7:33 am

Post by Raibaz »

I get the two NullReferenceExceptions too....but compiling and running under .NET 1.1...why is it?
luismesas
Posts: 8
Joined: Mon Oct 17, 2005 8:12 pm

Post by luismesas »

It seems to be a Memory access bug when using OpenGL as device Type. I got it at .Net 1.1 And .Net 2.0.

Wait to a future version to get it solved.
Raibaz
Posts: 4
Joined: Mon Oct 17, 2005 7:33 am

Post by Raibaz »

Strange thing is that it happens only using OpenGL as device type...switching to DirectX gives no exceptions on shutdown...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I think it is a bug in my code. I'm going to find it.
TOP-Proto
Posts: 14
Joined: Sun Jun 25, 2006 8:41 pm

Post by TOP-Proto »

Did you ever fix this?

I have spent a day closing every possible thing from devices to being null to closing instantiated classes, even garbage collecting, but the only thing that i was able to do was to switch graphics to directX.

Alot of people love OpenGL, anyone know how to fix this one?
Locked