Original Post
Can anyone give me an idea why this might be happening?
I have a basic DX9 program running which prints labels to the screen using the Direct3D.Font class. It works perfectly expect for one thing... After 625 Frames, it crashes, giving me the error ''Cannot access a disposed object named Microsoft.DirectX.Direct3D.Font"''. I''m haven''t disposed it, heck, I don''t ''have'' code to dispose it. What''s VERY odd is that it draws 8 labels per second, so it crashes after 625*8 or 5000 frames.
My label printing function consists of:
Public Sub DrawLabel(ByRef pLabel As clsMenuLabel)
dxFont = New Direct3D.Font(D3DDevice, New Drawing.Font(FontFamily.GenericSansSerif, pLabel.FontSize, FontStyle.Regular, GraphicsUnit.Pixel))
dxFont.DrawText(pLabel.Text, New Rectangle(pLabel.X + pLabel.Parent.X, pLabel.Y + pLabel.Parent.Y, 800, 600), DrawTextFormat.Left Or DrawTextFormat.Top Or DrawTextFormat.WordBreak, pLabel.DrawColor)
End Sub
Note that the error doesn''t occur if I omit the dxFont = New Direct3d.font line...
Does anyone have a clue how I screwed this up?