Hi,
is there a reason why the Dispose funktion of the RadAutoCompleteBox is not declared as virtual? We have implemented our own derived Class BDLAutoCompleteBox that has its own Dispose funktion and calls the base.Dispose funktion. We need this to extend the funktionality of the Class to our specific needs. We also have a workaround in the Dipose to clear a Memory leak:
public
new
void
Dispose()
{
this
.GotFocus -=
this
.BdlAutoCompleteBoxGotFocus;
this
.SelectionChanged -=
this
.BdlAutoCompleteBoxSelectionChanged;
this
.MouseRightButtonDown -=
this
.BdlAutoCompleteBoxMouseRightButtonDown;
this
.MouseRightButtonUp -=
this
.BdlAutoCompleteBoxMouseRightButtonUp;
if
(!
this
.isDisposed)
{
try
{
// Fix, für Telerik memory leak (SizeChanged handler des textBoxPart, wird dadurch aber nicht ganz behoben)
Type typeAutoCompleteBox =
typeof
(RadAutoCompleteBox);
System.Reflection.FieldInfo field = typeAutoCompleteBox.GetField(
"textBoxPart"
, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
if
(field !=
null
)
{
field.SetValue(
this
,
null
);
}
}
catch
(Exception)
{
//TG: Only Workaround for MemoryLeak, Exceptions should not be thrown in this case
}
}
this
.isDisposed =
true
;
base
.Dispose();
}
Best Regards
Matthias