If an UltraWinChart is disposed of and removed from a form, that chart may throw an unhandled NullReferenceException when the form repaints.
The IGWinTooltip class of an UltraWinChart registers for the top level form's Paint event, but doesn't unregister when the IGWinTooltip is disposed of. This causes the IGWinTooltip to handle the Paint event of the form while it's in a disposed state. While the IGWinTooltip is in a disposed state, it attempts to reference a private memeber that was set to null in its Dispose() implementation.
Can anyone at Infragistics confirm this and give some idea as to when this might be fixed? I've worked around the issue by overriding my form's OnPaint event and hiding the exception.
-Mike
i understand what you mean, however i don't see a potential null reference in that Paint event handler. can you provide a sample project or steps to reproduce?
I've got my own job with stuff to do. I don't have time to create a sample project that points this issue out to you, that's your job.
The exception actually happens in the AddToControlsCollection() method of the IGWinTooltip class, not the paint handler. The paint handler is what invokes the AddToControlsCollection() method. The AddToControlsCollection() method assumes that the private topLevel field is not null. If the class is disposed of, then the topLevel field is set to null. If the AddToControlsCollection() method is called after being disposed of, then a NullReferenceException will be thrown.
It doesn't get any clearer than that. Could you take a look again?