Profile Picture

GDI leak in NTextBox?

Posted By Craig Swearingen 9 Years Ago
Author
Message
Craig Swearingen
Question Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
I've been testing my application looking for leaks.  Specifically, looking for GDI leaks I've been using the Bear tool to help with this: http://thesz.diecru.eu/content/bear.php

In my application I have a global Font object that I use in various places within my application.  On one of my windows I set the Font property to be this global Font on both an NTextBox and an NTreeViewEx widget.  When loading this window and viewing in the Bear tool I see the application GDI Font total go up by one.  When I close this window the GDI Font total doesn't change though I know my window is being disposed of correctly.  Every time I open and close the window my GDI Font total goes up one more.

When I stop assigning the window's NTextBox Font property my global Font object I don't see this happening in the Bear tool.  It seems like the NTextBox is not disposing of the Font its creating when the widget is disposed.  Is there a Font GDI leak in the NTextBox code?


Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hello Craig,

Could you check this issue with System.Windows.Forms.TextBox instead of NTextBox because NTextBox inherits from it, and NTextBox does not use Font property anywhere in its implementation.




Best Regards,
Nevron Support Team



Craig Swearingen
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
Thanks for the idea.  Yes, you're right.  When I replace the NTextBox with a TextBox I continue to see the same issue that looks like a leak.  Not sure it is but its definitely not a Nevron issue.



Similar Topics


Reading This Topic