Prev: FileStream Bug
Next: Combobox scroll issue
From: Gary C on 16 Feb 2010 21:33 This posting relates to C# under Windows CE 6.0 R2. We used "this.Font" in a class derived from Control. The this.Font object was passed to Graphics.DrawString as an argument in the Paint handler. If we force several paints, PowerToys Logging Options with "Finalizer" checked shows a Font object being finalized for each paint in the log (each usage of Font). Oddly, if we assign this.Font to a local variable and Dispose the local variable in the paint after it is used then the Finalizer log no longer shows fonts being finalized. If we run the same code on Windows XP, the Dispose causes a crash. If we use our own font in a local variable we only see one finalize. It almost seems that the property "this.Font" returns a copy under CE - almost like a value type. But, on XP this property returns a reference. Have other encountered this?
|
Pages: 1 Prev: FileStream Bug Next: Combobox scroll issue |