An unhandled exception of type 'OpenTK.Graphics.GraphicsContextException' occurred in OpenTK.dll
Is all I’m getting once the game crashes, as can be seen here:
It started happening few weeks ago, but I didn’t mind it because it happened once in a blue moon. But now it’s happening every few seconds, and its really frustrating. I don’t know what is causing it and I cant find any information regarding it.
At first I thought simple re-install of monogame will fix it, but yesterday I formatted my pc, installed windows 10, new visual studio and fresh new Monogame, and its still happening! Anyone knows what this is and what can I do?
The crashes occur because window gets destroyed before resources get disposed of, fix for it is: https://github.com/mono/MonoGame/pull/4046 , mono and .net GC works different and I have done a lazy fix with the last commit(just checked if the window handle is valid). This means that if you are using a single window you won’t notice anything, but if you are using multiple windows you have to dispose of all the resources before calling the new window.
@cra0zy I don’t understand what do you mean, I didn’t destroy any window, I didn’t create any new windows, I was just simply playing on 1 window game and it crashes in the middle
@cra0zy I see, so I need to apply manually everything you rewrote and removed in the fixup for it to work? honestly I’m not sure I want to use openGL, when switching to directx it seemed like the game performance got a lot better than before, but if I wont be able to fix the bug I guess I will try your fix.
@cra0zy uhm, I downloaded your monogame solution but I’m abit confused of how do I replace it with my current monogame, these are the source files, how do I use them?