Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Crash occur after closing window  (Read 9776 times)

0 Members and 1 Guest are viewing this topic.

rpgmaker

  • Newbie
  • *
  • Posts: 38
    • View Profile
Crash occur after closing window
« 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".

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash occur after closing window
« Reply #1 on: January 18, 2009, 08:01:43 pm »
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.
Laurent Gomila - SFML developer

rpgmaker

  • Newbie
  • *
  • Posts: 38
    • View Profile
Crash occur after closing window
« Reply #2 on: January 18, 2009, 08:12:09 pm »
Yes, it happens when i close the window. How can i avoid the error?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash occur after closing window
« Reply #3 on: January 18, 2009, 09:25:28 pm »
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.
Laurent Gomila - SFML developer

rpgmaker

  • Newbie
  • *
  • Posts: 38
    • View Profile
Crash occur after closing window
« Reply #4 on: January 18, 2009, 10:00:27 pm »
I guess i will have to wait for the fix

ptrxyz

  • Newbie
  • *
  • Posts: 32
    • View Profile
Crash occur after closing window
« Reply #5 on: May 17, 2009, 08:54:18 pm »
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 ;)

ptrxyz

  • Newbie
  • *
  • Posts: 32
    • View Profile
Crash occur after closing window
« Reply #6 on: September 20, 2009, 04:21:21 pm »
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?

rpgmaker

  • Newbie
  • *
  • Posts: 38
    • View Profile
Crash occur after closing window
« Reply #7 on: September 20, 2009, 07:55:33 pm »
One way, i fixed the problem temporary for the crashing is by calling the below code right after the renderWindow#Close method.

Code: [Select]

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();

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
Crash occur after closing window
« Reply #8 on: November 14, 2009, 11:55:40 pm »
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash occur after closing window
« Reply #9 on: November 15, 2009, 09:25:36 am »
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?
Laurent Gomila - SFML developer

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
Crash occur after closing window
« Reply #10 on: November 15, 2009, 02:27:25 pm »
You are right, it doesn't (visibly?) crash when it runs outside of the debugger.

My workaround looks like this:
Code: [Select]
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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Crash occur after closing window
« Reply #11 on: November 15, 2009, 04:49:33 pm »
Quote
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.

Quote
Will there ever be a fix for this?

Sure.
Laurent Gomila - SFML developer