We noticed that RadGridView does not get garbagecollected sometimes.
So i fired up a memory analyzer to see what is going on.
This is the graph that shows that the RadGridView is causing a leak. The only references that keep the GridView from getting collected are those two WeakEventListeners
To further investigate i decompiled GridViewDataControl and could identify the culprit.
private void SubscribeToDispatcherShutdown()
{
if (this.dispatcherShutdownListener != null)
this.dispatcherShutdownListener.Detach();
this.dispatcherShutdownListener = new WeakEventListener<GridViewDataControl, object, EventArgs>(this);
this.dispatcherShutdownListener.OnEventAction = (Action<GridViewDataControl, object, EventArgs>) ((grid, source, eventArgs) => grid.OnDispatcherShutdownFinished(source, eventArgs));
this.dispatcherShutdownListener.OnDetachAction = (Action<WeakEventListener<GridViewDataControl, object, EventArgs>>) (weakEventListener => this.Dispatcher.ShutdownFinished -= new EventHandler(this.dispatcherShutdownListener.OnEvent));
this.Dispatcher.ShutdownFinished += new EventHandler(this.dispatcherShutdownListener.OnEvent);
}
In the second line from the botton
... weakEventListener => this.Dispatcher.ShutdownFinished -