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

Author Topic: [SFML 2.0] App. crash when using Image and quitting the app?  (Read 2910 times)

0 Members and 1 Guest are viewing this topic.

diRe

  • Newbie
  • *
  • Posts: 13
    • View Profile
Hello,

I recently restarted working on my current project using SFML.Net 2.0.

I encounted a crash, whenever loading some *.png files and then quitting the program. So I looked into it, and it seems, the crash always occurs when loading an Image (Image foo = new Image("file.png"); ) and then quitting the program.

Specifically, the following code results in an App. crash after the program ends:
Code: [Select]
   public static class Program
    {
        public static void Main() {
            SFML.Graphics.Image img = new SFML.Graphics.Image("img/enemy.png");
            Console.WriteLine("{0} x {1} px", img.Width, img.Height); // All fine, resulting text is as expected
        }
    }


I downloaded the latest SFML.Net 2.0 Snapshot, but still the same problem. Anyone else running into this problem?

diRe

  • Newbie
  • *
  • Posts: 13
    • View Profile
[SFML 2.0] App. crash when using Image and quitting the app?
« Reply #1 on: June 21, 2011, 09:09:46 pm »
So, as nobody answered I seem to be the only (testing) person to run into this problem.

Now, I tried everything:
x86 .Net and C
x64 .Net and C
as they were provided in the Snapshot. I even recompiled everything and tried again, still the same.

If it helps anything, there was this one time, when the console printed an error message: "Failed to share OpenGL context." (or something like that).

Now I switched back to Version 1.6 and everything works just fine.

BuGG

  • Newbie
  • *
  • Posts: 7
    • View Profile
[SFML 2.0] App. crash when using Image and quitting the app?
« Reply #2 on: July 08, 2011, 04:22:10 pm »
I copied your code into a new project and it runs fine here using VS 2010 x86 profile. (C# / SFML.NET 2.0)