SFML community forums
Bindings - other languages => DotNet => Topic started by: rpgmaker on January 18, 2009, 07:48:10 pm
-
I get the error below everytime i close the window if i use Sprite2D
The instruction at "0x69081124" referenced memory at "0x08092778". The memory could not be "written".
-
Did you mean "when I close the program if I use String2D"?
If so, it's a known bug, it happens when the default font is destroyed.
-
Yes, it happens when i close the window. How can i avoid the error?
-
You can try to use a custom font, and passing it directly to the constructor of your String2D. This way, the default font doesn't get instanciated and destroyed.
If it doesn't work, you'll have to wait for the bug to be fixed.
-
I guess i will have to wait for the fix
-
got the same problem....basically this error means you can not use any textoutput and publish your application =/
So bump to a pretty urgent bug ;)
-
Oh another bump to this...current SVN didn't solve the problem.
And the workaround doesn't do so too.... =(
So, any news to this?
-
One way, i fixed the problem temporary for the crashing is by calling the below code right after the renderWindow#Close method.
MethodInfo shutDown = typeof(Microsoft.Win32.SystemEvents).GetMethod("Shutdown", BindingFlags.NonPublic | BindingFlags.Static,
(Binder)null, new Type[] { }, new ParameterModifier[] { });
shutDown.Invoke(null, new object[] { });
Process.GetCurrentProcess().Kill();
-
Is this considered as fixed in the latest SVN?
It's still crashing for me when I pass a font directly to the String2D contructor.
-
For me, it happens only when running the debug version from the EDI, there's no crash when I run the executable directly. Same for you?
-
You are right, it doesn't (visibly?) crash when it runs outside of the debugger.
My workaround looks like this:
if (Debugger.IsAttached)
Process.GetCurrentProcess().Kill();
So it only gets killed when run in the debugger.
Why does it crash in the debugger? Will there ever be a fix for this?
-
Why does it crash in the debugger?
I have no idea. Maybe it has something to do with the "hack" I have to use to ensure a proper destruction of objects, that happen in a separate thread (the GC one) after the main one has ended.
Will there ever be a fix for this?
Sure.