haymo's picture

Font disposing

When do I have to dispose TextureFont objects? I'm using it as a member of my own wrapper class and thought, I should dispose the existing object, before replacing them with a new one. But it appears, a fresh created TextureFont cannot get disposed?

OpenTK.Graphics.TextureFont testfont = new TextureFont(new Font("Arial",10.0f));
testfont.Dispose(); //throws NullReferenceException

I think, its because no texture has been attached to the font, right? But how can I tell from outside?

this is not the current svn, maybe this has already been fixed?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Yes, it seems we are trying to delete texture #0 in this case - but this shouldn't crash with an NRE. I'll take a look tonight.